Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created March 4, 2016 14:22
Show Gist options
  • Save AndyNovo/74f87f5fb8263f03adaa to your computer and use it in GitHub Desktop.
Save AndyNovo/74f87f5fb8263f03adaa to your computer and use it in GitHub Desktop.
s1 = 3904654068
s2 = 897137925
s3 = 4281244274
m = 2**32
M = matrix(Zmod(m), 2, 2, [s1, 1, s2, 1])
abv = M.inverse()*matrix(Zmod(m), 2, 1, [s2, s3])
a = abv[0,0]
b = abv[1,0]
s4 = (s3*a + b) % m
s5 = (a*s4 + b) % m
print s5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment