1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-11-30 04:39:02 +01:00

Merge branch '1.0' into 2.0

This commit is contained in:
terrafrost 2016-03-19 12:23:04 -05:00
commit 6bfbfdbf7e
2 changed files with 12 additions and 1 deletions

View File

@ -1824,7 +1824,7 @@ class BigInteger
// calculate the appropriate window size.
// $window_size == 3 if $window_ranges is between 25 and 81, for example.
for ($i = 0, $window_size = 1; $e_length > $window_ranges[$i] && $i < count($window_ranges); ++$window_size, ++$i) {
for ($i = 0, $window_size = 1; $i < count($window_ranges) && $e_length > $window_ranges[$i]; ++$window_size, ++$i) {
}
$n_value = $n->value;

View File

@ -371,4 +371,15 @@ abstract class Unit_Math_BigInteger_TestCase extends PhpseclibTestCase
$this->assertContains('[value] => 0x32', $str);
return $str;
}
/**
* @group github954
*/
public function testSlidingWindow()
{
$e = $this->getInstance(str_repeat('1', 1794), 2);
$x = $this->getInstance(1);
$n = $this->getInstance(2);
$x->powMod($e, $n);
}
}