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:125:
for (;;) { /* Generate q */ string(8bit) seed = random(SEED_LENGTH); Gmp.mpz s = Gmp.mpz(seed, 256); string(8bit) h = [string(8bit)] (nist_hash(s) ^ nist_hash( [object(Gmp.mpz)](s + 1) ));
-
h = sprintf("%c%s%c", h[0] | 0x80, h[1..<1], h[-1] | 1);
+
h = sprintf("%c%s%c",
+
[int(8bit)](
h[0] | 0x80
)
,
+
h[1..<1],
+
[int(8bit)](
h[-1] | 1)
)
;
Gmp.mpz q = Gmp.mpz(h, 256); if (!q->probably_prime_p()) continue; /* q is a prime, with overwelming probability. */ int i, j;