#include <crt_blocks.hpp>
Definition at line 87 of file crt_blocks.hpp.
typedef WL::base base |
Definition at line 89 of file crt_blocks.hpp.
typedef WL::modulus_base modulus_base |
Definition at line 91 of file crt_blocks.hpp.
typedef WL::modulus_base_variant modulus_base_variant |
Definition at line 92 of file crt_blocks.hpp.
typedef WL::modulus_variant modulus_variant |
Definition at line 90 of file crt_blocks.hpp.
crt_blocks_transformer | ( | const vector< M > & | p, | |
bool | lazy = true | |||
) | [inline] |
Definition at line 121 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::aux, crt_blocks_transformer< WL, WH, s, V >::H, crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, crt_blocks_transformer< WL, WH, s, V >::m, min(), mmx::N(), crt_blocks_transformer< WL, WH, s, V >::n, crt_blocks_transformer< WL, WH, s, V >::P, crt_blocks_transformer< WL, WH, s, V >::product(), mmx::range(), and crt_blocks_transformer< WL, WH, s, V >::setup.
00121 { 00122 n= N(p); m= (n + s - 1) / s; setup= !lazy; 00123 if (n == 0) { P= 1; H= 0; return; } 00124 low= mmx_new<WL*> (m); 00125 vector<Modulus> v (Modulus (), m); 00126 for (nat i= 0; i < m; i++) { 00127 low[i]= mmx_new<WL> (1, range (p, i * s, min (n, (i+1) * s)), lazy); 00128 v[i]= low[i] -> product (); 00129 } 00130 high= mmx_new<WH> (1, v, lazy); 00131 P= high -> product (); 00132 H= Crt::half (P); 00133 aux= mmx_new<C> (m); }
~crt_blocks_transformer | ( | ) | [inline] |
void combine | ( | C & | a, | |
const I * | c | |||
) | [inline] |
Definition at line 161 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::aux, crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, crt_blocks_transformer< WL, WH, s, V >::m, crt_blocks_transformer< WL, WH, s, V >::n, and crt_blocks_transformer< WL, WH, s, V >::setup_comoduli().
00161 { 00162 if (n == 0) { a= 0; return; } 00163 setup_comoduli (); 00164 Crt::combine (a, c, low, high, aux, m, s); }
C comodulus | ( | nat | i | ) | const [inline] |
Definition at line 152 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, and crt_blocks_transformer< WL, WH, s, V >::n.
void direct_transform | ( | I * | c, | |
const C & | a | |||
) | [inline] |
Definition at line 156 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::aux, crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, crt_blocks_transformer< WL, WH, s, V >::m, crt_blocks_transformer< WL, WH, s, V >::n, and crt_blocks_transformer< WL, WH, s, V >::P.
void inverse_transform | ( | C & | a, | |
const I * | c | |||
) | [inline] |
Definition at line 166 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::aux, crt_blocks_transformer< WL, WH, s, V >::H, crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, crt_blocks_transformer< WL, WH, s, V >::m, crt_blocks_transformer< WL, WH, s, V >::n, crt_blocks_transformer< WL, WH, s, V >::P, and crt_blocks_transformer< WL, WH, s, V >::setup_inverse().
M operator[] | ( | nat | i | ) | const [inline] |
Definition at line 142 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::low, and crt_blocks_transformer< WL, WH, s, V >::n.
00142 { 00143 VERIFY (i < n, "index out of range"); 00144 return low[i / s]-> operator [] (i % s); }
Modulus product | ( | ) | const [inline] |
Definition at line 149 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::P.
Referenced by crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer().
00149 { 00150 return P; }
void setup_comoduli | ( | ) | [inline] |
Definition at line 111 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::combine().
void setup_inverse | ( | ) | [inline] |
Definition at line 114 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::high, crt_blocks_transformer< WL, WH, s, V >::low, crt_blocks_transformer< WL, WH, s, V >::m, and crt_blocks_transformer< WL, WH, s, V >::setup.
Referenced by crt_blocks_transformer< WL, WH, s, V >::inverse_transform().
00114 { 00115 if (setup) return; 00116 high -> setup_inverse (); 00117 for (nat i= 0; i < m; i++) 00118 low[i] -> setup_inverse (); 00119 setup= true; }
nat size | ( | ) | const [inline] |
Definition at line 146 of file crt_blocks.hpp.
References crt_blocks_transformer< WL, WH, s, V >::n.
Referenced by mmx::N().
00146 { 00147 return n; }
C* aux |
Definition at line 106 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::combine(), crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), crt_blocks_transformer< WL, WH, s, V >::direct_transform(), crt_blocks_transformer< WL, WH, s, V >::inverse_transform(), and crt_blocks_transformer< WL, WH, s, V >::~crt_blocks_transformer().
C H |
Definition at line 108 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), and crt_blocks_transformer< WL, WH, s, V >::inverse_transform().
WH* high |
Definition at line 105 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::combine(), crt_blocks_transformer< WL, WH, s, V >::comodulus(), crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), crt_blocks_transformer< WL, WH, s, V >::direct_transform(), crt_blocks_transformer< WL, WH, s, V >::inverse_transform(), implementation< matrix_multiply, V, matrix_crt< W > >::mul(), crt_blocks_transformer< WL, WH, s, V >::setup_inverse(), and crt_blocks_transformer< WL, WH, s, V >::~crt_blocks_transformer().
WL** low |
Definition at line 104 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::combine(), crt_blocks_transformer< WL, WH, s, V >::comodulus(), crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), crt_blocks_transformer< WL, WH, s, V >::direct_transform(), crt_blocks_transformer< WL, WH, s, V >::inverse_transform(), implementation< matrix_multiply, V, matrix_crt< W > >::mul(), crt_blocks_transformer< WL, WH, s, V >::operator[](), crt_blocks_transformer< WL, WH, s, V >::setup_inverse(), and crt_blocks_transformer< WL, WH, s, V >::~crt_blocks_transformer().
nat m |
Definition at line 103 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::combine(), crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), crt_blocks_transformer< WL, WH, s, V >::direct_transform(), crt_blocks_transformer< WL, WH, s, V >::inverse_transform(), crt_blocks_transformer< WL, WH, s, V >::setup_inverse(), and crt_blocks_transformer< WL, WH, s, V >::~crt_blocks_transformer().
nat n |
Definition at line 103 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::combine(), crt_blocks_transformer< WL, WH, s, V >::comodulus(), crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), crt_blocks_transformer< WL, WH, s, V >::direct_transform(), crt_blocks_transformer< WL, WH, s, V >::inverse_transform(), crt_blocks_transformer< WL, WH, s, V >::operator[](), crt_blocks_transformer< WL, WH, s, V >::size(), and crt_blocks_transformer< WL, WH, s, V >::~crt_blocks_transformer().
Definition at line 107 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), crt_blocks_transformer< WL, WH, s, V >::direct_transform(), crt_blocks_transformer< WL, WH, s, V >::inverse_transform(), and crt_blocks_transformer< WL, WH, s, V >::product().
bool setup |
Definition at line 109 of file crt_blocks.hpp.
Referenced by crt_blocks_transformer< WL, WH, s, V >::crt_blocks_transformer(), and crt_blocks_transformer< WL, WH, s, V >::setup_inverse().