mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-27 17:18:25 +00:00
[feature/elliptic-curve] Assign a variable to Math_BigInteger(1).
This commit is contained in:
parent
a730ed6e4c
commit
50f5f3f97e
@ -1193,13 +1193,13 @@ class Net_SSH2 {
|
||||
[VAN-OORSCHOT].
|
||||
|
||||
-- http://tools.ietf.org/html/rfc4419#section-6.2 */
|
||||
$q = new Math_BigInteger(1);
|
||||
$q = $q->bitwise_leftShift(16 * $keyLength); // 2 * 8 * $keyLength
|
||||
$q = $q->subtract(new Math_BigInteger(1));
|
||||
$one = new Math_BigInteger(1);
|
||||
$q = $one->bitwise_leftShift(16 * $keyLength); // 2 * 8 * $keyLength
|
||||
$q = $q->subtract($one);
|
||||
|
||||
$g = new Math_BigInteger(2);
|
||||
$x = new Math_BigInteger();
|
||||
$x = $x->random(new Math_BigInteger(1), $q);
|
||||
$x = $x->random($one, $q);
|
||||
$e = $g->modPow($x, $p);
|
||||
|
||||
$eBytes = $e->toBytes(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user