1 #ifndef MTTOOLBOX_ALGORITHM_REDUCIBLE_RECURSION_SEARCH_HPP
2 #define MTTOOLBOX_ALGORITHM_REDUCIBLE_RECURSION_SEARCH_HPP
37 #include <NTL/GF2XFactoring.h>
46 template<
typename U,
typename V = U>
83 template<
typename U,
typename V = U>
124 long mexp = rand->getMexp();
125 for (
int i = 0; i < try_count; i++) {
126 rand->setUpParam(*baseGenerator);
127 rand->seed(getOne<U>());
129 cout <<
"rand param:";
130 cout << rand->getParamString() << endl;
135 if (deg(irreducible) < mexp) {
137 cout <<
"irrepoly deg = " << deg(irreducible)
144 cout <<
"has factor = " << hasFactor << endl;
148 cout <<
"not has factor of degree irrepoly deg = "
149 << deg(irreducible) <<
" skip" << endl;
153 degree = deg(irreducible);
154 if (degree != mexp) {
156 cout <<
"degree:" << degree <<
"degree != mexp skip"
170 return rand->getParamString();
226 NTL::GF2X irreducible;
251 template<
typename U,
typename V = U>
256 cout <<
"calcCharacteristicPolynomial start" << endl;
258 int bitsize = bit_size<U>();
260 NTL::GF2X lcmpoly = poly;
262 for (
int i = 0; i < bitsize; i++) {
263 if (deg(lcmpoly) == size) {
266 cout <<
"calcCharacteristicPolynomial end" << endl;
271 LCM(lcmpoly, lcmpoly, minpol);
275 cout <<
"calcCharacteristicPolynomial end" << endl;
279 #endif // MTTOOLBOX_ALGORITHM_REDUCIBLE_RECURSION_SEARCH_HPP
This file provides functions calculating minimal polynomials and checking primitivity.