Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@autotaker
Created March 20, 2017 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save autotaker/c2a4481d5f18d35e913503664320a016 to your computer and use it in GitHub Desktop.
Save autotaker/c2a4481d5f18d35e913503664320a016 to your computer and use it in GitHub Desktop.
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