diff --git a/src/Optimized/Common/BarretReductionTrait.php b/src/Optimized/Common/BarretReductionTrait.php index c9a6c4e..e6bc86b 100644 --- a/src/Optimized/Common/BarretReductionTrait.php +++ b/src/Optimized/Common/BarretReductionTrait.php @@ -30,7 +30,6 @@ protected function barrettReduce(GMP $product): GMP $r = $ctMath->select($b, $rPrime, $r); // Guaranteed to be reduced after 2 cycles - $tmp = 0; for ($i = 0; $i < 2; ++$i) { $rPrime = $r - $this->p; // $b = 1 if $rPrime > 0, which means subtracting is necessary diff --git a/src/Optimized/P256.php b/src/Optimized/P256.php index b90c0f8..95b6cee 100644 --- a/src/Optimized/P256.php +++ b/src/Optimized/P256.php @@ -293,33 +293,6 @@ public function subElements(GMP $a, GMP $b): GMP return $this->ctMath->select($swap, $cPrime, $c); } - /** - * @return JacobiPoint[][] - */ - private function runtimeGeneratorTable(): array - { - $table = []; - $base = new JacobiPoint(); - /** @var GMP $x */ - $x = gmp_init('0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296', 16); - /** @var GMP $y */ - $y = gmp_init('0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5', 16); - $base->x = $x; - $base->y = $y; - $base->z = gmp_init(1, 10); - - for ($i = 0; $i < 64; ++$i) { - $table[$i][0] = clone $base; - for ($j = 1; $j < 15; ++$j) { - $table[$i][$j] = $this->addInternal($base, $table[$i][$j - 1]); - } - for ($j = 0; $j < 4; ++$j) { - $base = $this->doubleInternal($base); - } - } - return $table; - } - /** * @param JacobiPoint $q * @return JacobiPoint[]