1 | initial version |
Try this:
pol = lfsr_connection_polynomial(L)
P = PolynomialRing(GF(2),'y')
R.<y> = P.quotient(pol)
O = 2^pol.degree()-1
for p,d in factor(O):
while (O%p==0) and (y^(O//p)==1):
O //= p
print("order =",O)
2 | No.2 Revision |
Try this:
pol = lfsr_connection_polynomial(L)
P = PolynomialRing(GF(2),'y')
R.<y> = P.quotient(pol)
O = 2^pol.degree()-1
for p,d in factor(O):
while (O%p==0) and (y^(O//p)==1):
O //= p
print("order print("period =",O)
3 | No.3 Revision |
Try this:
pol = lfsr_connection_polynomial(L)
P = PolynomialRing(GF(2),'y')
R.<y> = P.quotient(pol)
O = 2^pol.degree()-1
for p,d p,_ in factor(O):
while (O%p==0) and (y^(O//p)==1):
O //= p
print("period =",O)