mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-13 17:18:42 +00:00
Merge branch '2.0'
This commit is contained in:
commit
ab270d1602
@ -206,7 +206,7 @@ abstract class Engine implements \Serializable
|
|||||||
$temp = $comparison < 0 ? $this->add(new static(1)) : $this;
|
$temp = $comparison < 0 ? $this->add(new static(1)) : $this;
|
||||||
$bytes = $temp->toBytes();
|
$bytes = $temp->toBytes();
|
||||||
|
|
||||||
if (empty($bytes)) { // eg. if the number we're trying to convert is -1
|
if (!strlen($bytes)) { // eg. if the number we're trying to convert is -1
|
||||||
$bytes = chr(0);
|
$bytes = chr(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -375,6 +375,7 @@ abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase
|
|||||||
$n = $this->getInstance(2);
|
$n = $this->getInstance(2);
|
||||||
$x->powMod($e, $n);
|
$x->powMod($e, $n);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRoot()
|
public function testRoot()
|
||||||
{
|
{
|
||||||
$bigInteger = $this->getInstance('64000000'); // (20^2)^3
|
$bigInteger = $this->getInstance('64000000'); // (20^2)^3
|
||||||
@ -429,4 +430,13 @@ abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase
|
|||||||
$b = $this->getInstance('00', 16);
|
$b = $this->getInstance('00', 16);
|
||||||
$this->assertTrue($a->equals($b));
|
$this->assertTrue($a->equals($b));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group github1264
|
||||||
|
*/
|
||||||
|
public function test48ToHex()
|
||||||
|
{
|
||||||
|
$temp = $this->getInstance(48);
|
||||||
|
$this->assertSame($temp->toHex(true), '30');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user