BigInteger/Engines/PHP: HAC 14.42.2 does mod $b^{k+1}$

This commit is contained in:
terrafrost 2017-11-04 12:28:38 -05:00
parent 5e9c67b2d0
commit 5eec16041d

View File

@ -131,6 +131,11 @@ abstract class EvalBarrett extends Base
$code.= self::generateInlineMultiply('temp', $m, 'temp2', $class); $code.= self::generateInlineMultiply('temp', $m, 'temp2', $class);
$code.= self::generateInlineTrim('temp2'); $code.= self::generateInlineTrim('temp2');
if ($class::BASE == 26) {
$code.= '$n = array_slice($n, 0, ' . (count($m) + 1) . ');
$temp2 = array_slice($temp2, 0, ' . (count($m) + 1) . ');';
}
$code.= self::generateInlineSubtract2('n', 'temp2', 'temp', $class); $code.= self::generateInlineSubtract2('n', 'temp2', 'temp', $class);
$subcode = self::generateInlineSubtract1('temp', $m, 'temp2', $class); $subcode = self::generateInlineSubtract1('temp', $m, 'temp2', $class);