c - Reverse Modulus Operator with given condition -
i have equation:
x^2 mod p = z ; p , z given. x,p , z positive integers , max value of x given (say m). p prime. how can calculate (multiple possible values) x when p , z known ?
update:
i found solution here:
if x^2 mod p = z
x^2 = n*p + z integer n
p , z known, substitute integer values n find x
Comments
Post a Comment