DSA Validation Calculation

Am I missing something? from FIPS180-2 , on page 25, it gives the values ​​u1, u2, g ^ u1 mod p, y ^ u2 mod p and v. I calculated all values ​​except v. However, when I do the math, my calculations refuse to be v = 0x8bac1ab66410435cb7181f95b16ab97c92b341c0. instead, I get v = 0xc5a54698ae8e5b94661134260594ff4e3f488e26, which is not equal to r, initially. im do (pow(g, u1, p) * pow(y, u2, p)) % qto calculate where powis the built-in function, not the function of the math module

+3
source share
1 answer

You are missing one calculation mod p. You should calculate:

(((pow(g, u1, p) * pow(y, u2, p))) % p ) % q

+5
source

Source: https://habr.com/ru/post/1781305/


All Articles