mirror of
https://github.com/danog/phpseclib.git
synced 2024-12-14 01:57:20 +01:00
[feature/elliptic-curve] Rename $q to $max because that's what it is.
This commit is contained in:
parent
50f5f3f97e
commit
97cf60900d
@ -1194,12 +1194,11 @@ class Net_SSH2 {
|
|||||||
|
|
||||||
-- http://tools.ietf.org/html/rfc4419#section-6.2 */
|
-- http://tools.ietf.org/html/rfc4419#section-6.2 */
|
||||||
$one = new Math_BigInteger(1);
|
$one = new Math_BigInteger(1);
|
||||||
$q = $one->bitwise_leftShift(16 * $keyLength); // 2 * 8 * $keyLength
|
$max = $one->bitwise_leftShift(16 * $keyLength)->subtract($one); // 2 * 8 * $keyLength
|
||||||
$q = $q->subtract($one);
|
|
||||||
|
|
||||||
$g = new Math_BigInteger(2);
|
$g = new Math_BigInteger(2);
|
||||||
$x = new Math_BigInteger();
|
$x = new Math_BigInteger();
|
||||||
$x = $x->random($one, $q);
|
$x = $x->random($one, $max);
|
||||||
$e = $g->modPow($x, $p);
|
$e = $g->modPow($x, $p);
|
||||||
|
|
||||||
$eBytes = $e->toBytes(true);
|
$eBytes = $e->toBytes(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user