Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
g = ffgen((x^128 + x^7 + x^2 + x + 1)* Mod(1,2), 'x);
int2ff(n, g) = { subst(Pol(digits(n, g.p)), 'x, g) };
ff2int(x) = { subst(x.pol, variable(x.pol), x.p) };
A = 264046295839861049478585915471640894461
B = 61271402786193883928865590532021375813
c0 = 18157014022896961033533781555789031836
c1 = 260901311726713247284389786686953430464
m0 = 105582216436208661598595896902456800032
m1 = 156118846101782610220930369443106988151
A = int2ff(A,g)
B = int2ff(B,g)
c0 = int2ff(c0, g)
c1 = int2ff(c1, g)
m0 = int2ff(m0, g)
m1 = int2ff(m1, g)
k0 = c0 + m0
k1 = c1 + m1
An = (k1 + B * (A-1)^(-1)) * (k0 + B * (A-1)^(-1))^(-1)
print(An)
print(fflog(An, A, fforder(A)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment