pike.git
/
lib
/
modules
/
Crypto.pmod
/
DSA.pmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/lib/modules/Crypto.pmod/DSA.pmod:382:
return [object(Gmp.mpz)](random_number([object(Gmp.mpz)](q - 1)) + 1); } //! Sign the message @[h]. Returns the signature as two @[Gmp.mpz] //! objects. array(Gmp.mpz) raw_sign(Gmp.mpz h, void|Gmp.mpz k) { if(!k) k = random_exponent(); Gmp.mpz r = [object(Gmp.mpz)](g->powm(k, p) % q);
-
Gmp.mpz s = [object(Gmp.mpz)]((k->invert(q) * (h + x*r)) % q);
+
Gmp.mpz s = [object(Gmp.mpz)]((k->invert(q) * (h +
[object(Gmp.mpz)](
x*r))
)
% q);
return ({ r, s }); } //! Verify the signature @[r],@[s] against the message @[h]. int(0..1) raw_verify(Gmp.mpz h, Gmp.mpz r, Gmp.mpz s) { Gmp.mpz w; if (catch {