Skip to content

Commit

Permalink
Cleanup dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed Apr 28, 2024
1 parent e2d2aac commit b5cd11a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
1 change: 0 additions & 1 deletion src/Optimized/Common/BarretReductionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 0 additions & 27 deletions src/Optimized/P256.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down

0 comments on commit b5cd11a

Please # to comment.