Tutorial with f4 library use for GF(2^n) with n < 64.
- Author
- Vanessa VITSE, Antoine JOUX, Titouan COLADON
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main (int argc, char **argv)
{
cout << "#########################################################" << endl;
cout << "# TUTORIAL WITH LIBRARY USE #" << endl;
cout << "#########################################################" << endl << endl;
vector<string> polynomialArray;
vector<string> variableName;
for(int i = 0; i < 6; i++)
{
variableName.push_back('x'+to_string(i));
}
polynomialArray.emplace_back("(t+t^3)*x0+(t+t^3)*x1+(t+t^3)*x2+(t+t^3)*x3+(t+t^3)*x4+(t+t^3)*x5");
polynomialArray.emplace_back("(t+t^3)*x0*x1+(t+t^3)*x1*x2+(t+t^3)*x2*x3+(t+t^3)*x3*x4+(t+t^3)*x0*x5+(t+t^3)*x4*x5");
polynomialArray.emplace_back("(t+t^3)*x0*x1*x2+(t+t^3)*x1*x2*x3+(t+t^3)*x2*x3*x4+(t+t^3)*x0*x1*x5+(t+t^3)*x0*x4*x5+(t+t^3)*x3*x4*x5");
polynomialArray.emplace_back("(t+t^3)*x0*x1*x2*x3+(t+t^3)*x1*x2*x3*x4+(t+t^3)*x0*x1*x2*x5+(t+t^3)*x0*x1*x4*x5+(t+t^3)*x0*x3*x4*x5+(t+t^3)*x2*x3*x4*x5");
polynomialArray.emplace_back("(t+t^3)*x0*x1*x2*x3*x4+(t+t^3)*x0*x1*x2*x3*x5+(t+t^3)*x0*x1*x2*x4*x5+(t+t^3)*x0*x1*x3*x4*x5+(t+t^3)*x0*x2*x3*x4*x5+(t+t^3)*x1*x2*x3*x4*x5");
polynomialArray.emplace_back("(t+t^3)*x0*x1*x2*x3*x4*x5-1");
vector<string> basis =
groebnerBasisGF2ExtensionF4(
"t^63 + t^61 + t^57 + t^56 + t^54 + t^51 + t^47 + t^46 + t^45 + t^44 + t^43 + t^42 + t^39 + t^38 + t^35 + t^34 + t^32 + t^31 + t^28 + t^25 + t^24 + t^23 + t^21 + t^19 + t^18 + t^17 + t^15 + t^13 + t^10 + t^8 + t^7 + t^5 + t^2 + t + 1", 6, variableName,
"t", polynomialArray, 1, 0);
for(size_t i = 0; i < basis.size(); i++)
{
cout << basis[i] << endl;
}
}