Bachelors_Thesis_Code/V1/generate_initial_irreducible_polynomials.sage
2021-11-14 14:35:05 +01:00

13 lines
318 B
Python

F = GF(2)
PR = PolynomialRing(F, 'x')
max_k = 31
whitespace = max_k+1
for i in range(1, max_k+1):
poly_int = '0b'+ ''.join(map(str, PR.irreducible_element(i).coefficients(sparse=False)[::-1]))
poly_int += ','
poly_int += ' '*(max_k-i)
print(f' {poly_int}// irreducible polynomial of degree {i}')