MTToolBox  0.2.10
AlgorithmPrimitivity.hpp
Go to the documentation of this file.
1 #ifndef MTTOOLBOX_ALGORITHM_PRIMITIVITY_HPP
2 #define MTTOOLBOX_ALGORITHM_PRIMITIVITY_HPP
3 
25 #include <NTL/GF2X.h>
26 #include <NTL/ZZ.h>
27 #include <NTL/vector.h>
28 #include <MTToolBox/period.hpp>
29 
30 namespace MTToolBox {
43  public:
56  primes = new NTL::Vec<NTL::ZZ>;
57  primes->SetLength(0);
58  mersenne = true;
59  }
60 
74  AlgorithmPrimitivity(const char * prime_factors[]);
75 
85  delete primes;
86  }
87 
106  bool operator()(int max_degree, const NTL::GF2X& poly) const;
107  private:
108  bool mersenne;
109  NTL::Vec<NTL::ZZ> * primes;
110  };
111 
125  extern const AlgorithmPrimitivity MersennePrimitivity;
126 
137  extern const char * prime_factors2_128_1[];
138 
149  extern const char * prime_factors2_160_1[];
150 
161  extern const char * prime_factors2_192_1[];
162 
173  extern const char * prime_factors2_224_1[];
174 
185  extern const char * prime_factors2_256_1[];
186 
197  extern const char * prime_factors2_288_1[];
198 
209  extern const char * prime_factors2_320_1[];
210 
221  extern const char * prime_factors2_352_1[];
222 
233  extern const char * prime_factors2_384_1[];
234 
245  extern const char * prime_factors2_416_1[];
246 
257  extern const char * prime_factors2_448_1[];
258 
269  extern const char * prime_factors2_480_1[];
270 
281  extern const char * prime_factors2_512_1[];
282 
293  extern const char * prime_factors2_544_1[];
294 
295 }
296 #endif // MTTOOLBOX_ALGORITHM_PRIMITIVITY_HPP
const char * prime_factors2_192_1[]
List of prime numbers appear in the factorization of 2192-1.
const char * prime_factors2_512_1[]
List of prime numbers appear in the factorization of 2512-1.
const char * prime_factors2_128_1[]
List of prime numbers appear in the factorization of 2128-1.
Algorithm which check if given polynomial is primitive.
Definition: AlgorithmPrimitivity.hpp:42
~AlgorithmPrimitivity()
Destructor.
Definition: AlgorithmPrimitivity.hpp:84
const AlgorithmPrimitivity MersennePrimitivity
An algorithm which checks if given polynomial is a primitive polynomial of given degree for pseudo ra...
AlgorithmPrimitivity()
Constructor for polynomials whose degrees are Mersenne Exponent.
Definition: AlgorithmPrimitivity.hpp:55
const char * prime_factors2_544_1[]
List of prime numbers appear in the factorization of 2544-1.
const char * prime_factors2_224_1[]
List of prime numbers appear in the factorization of 2224-1.
const char * prime_factors2_320_1[]
List of prime numbers appear in the factorization of 2320-1.
const char * prime_factors2_416_1[]
List of prime numbers appear in the factorization of 2416-1.
bool operator()(int max_degree, const NTL::GF2X &poly) const
Check if given polynomial is a primitive polynomial of given max_degree.
const char * prime_factors2_160_1[]
List of prime numbers appear in the factorization of 2160-1.
const char * prime_factors2_448_1[]
List of prime numbers appear in the factorization of 2448-1.
const char * prime_factors2_288_1[]
List of prime numbers appear in the factorization of 2288-1.
This file provides functions calculating minimal polynomials and checking primitivity.
const char * prime_factors2_480_1[]
List of prime numbers appear in the factorization of 2480-1.
const char * prime_factors2_256_1[]
List of prime numbers appear in the factorization of 2256-1.
const char * prime_factors2_384_1[]
List of prime numbers appear in the factorization of 2384-1.
const char * prime_factors2_352_1[]
List of prime numbers appear in the factorization of 2352-1.
name space for MTToolBox