chunker: Require a random irreducible polynomial

This also implements the necessary polynomial arithmetics in F_2[X].
This commit is contained in:
Alexander Neumann
2015-04-05 11:09:59 +02:00
parent 094ca7e635
commit 3cdf3a25b9
6 changed files with 749 additions and 10 deletions

View File

@@ -0,0 +1,25 @@
# This file is a script for GAP and tests a list of polynomials in hexadecimal
# for irreducibility over F_2
# create x over F_2 = GF(2)
x := Indeterminate(GF(2), "x");
# test if polynomial is irreducible, i.e. the number of factors is one
IrredPoly := function (poly)
return (Length(Factors(poly)) = 1);
end;;
# create a polynomial in x from the hexadecimal representation of the
# coefficients
Hex2Poly := function (s)
return ValuePol(CoefficientsQadic(IntHexString(s), 2), x);
end;;
# list of candidates, in hex
candidates := [ "3DA3358B4DC173" ];
# create real polynomials
L := List(candidates, Hex2Poly);
# filter and display the list of irreducible polynomials contained in L
Display(Filtered(L, x -> (IrredPoly(x))));