Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created April 15, 2016 12:22
Show Gist options
  • Save AndyNovo/17a4541a5103922f30fa87ad2af33e5b to your computer and use it in GitHub Desktop.
Save AndyNovo/17a4541a5103922f30fa87ad2af33e5b to your computer and use it in GitHub Desktop.
p=2602970321841479
g=2
x=2064002103016912
A=1376951019743626
K=1443056703658992
K_inv1 = power_mod(K, p-2, p)
K_inv2 = xgcd(p, K)[2] % p
K_inv3 = power_mod(A, p - 1- x, p)
print K_inv1* K % p
print K_inv2 * K % p
print K_inv3 * K % p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment