Am I missing something? from FIPS180-2, on page 25, it gives the values of u1, u2, g^u1 mod p, y^u2 mod p and v. i have calculated all the values except v. yet, when i do the math, my calculations refuse to be v = 0x8bac1ab66410435cb7181f95b16ab97c92b341c0. instead, i get v = 0xc5a54698ae8e5b94661134260594ff4e3f488e26, which is not equal to r, from before. im doing (pow(g, u1, p) * pow(y, u2, p)) % q
to do the calculation, where pow
is the builtin function, not the math module function
Asked
Active
Viewed 591 times
3

heget
- 33
- 2
-
What values do you get for `pow(g, u1, p)` and `pow(y, u2, p)`? – Anon. Dec 20 '10 at 20:05
-
i get the same values as the pdf – heget Dec 20 '10 at 20:07
1 Answers
5
You're skipping one mod p
calculation. You should compute:
(((pow(g, u1, p) * pow(y, u2, p))) % p ) % q

President James K. Polk
- 40,516
- 21
- 95
- 125