Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- '8.3'
- '8.4'
- '8.5'
- '8.6-dev'
- '8.6'

steps:
- name: Check out code
Expand Down
11 changes: 4 additions & 7 deletions src/PublicKey/EllipticCurve.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,13 @@ private function isOnCurve(): bool

// This is only tested with P256 (secp256r1) but SHOULD be the same for
// the other curves (none of which are supported yet)/
$x3 = $x ** 3; // @phpstan-ignore pow.leftNonNumeric (phpstan/phpstan#14288)
$ax = $a * $x; // @phpstan-ignore mul.leftNonNumeric, mul.rightNonNumeric (phpstan/phpstan#14288)
// phpcs:disable
$x3 = $x ** 3;
$ax = $a * $x;
// (need the long line for PHPStan to parse)
// @phpstan-ignore plus.leftNonNumeric, plus.leftNonNumeric, plus.rightNonNumeric, plus.rightNonNumeric, mod.leftNonNumeric, mod.rightNonNumeric (phpstan/phpstan#14288)
$rhs = ($x3 + $ax + $b) % $p;
// phpcs:enable

$y2 = $y ** 2; // @phpstan-ignore pow.leftNonNumeric (phpstan/phpstan#14288)
$lhs = $y2 % $p; // @phpstan-ignore mod.leftNonNumeric, mod.rightNonNumeric (phpstan/phpstan#14288)
$y2 = $y ** 2;
$lhs = $y2 % $p;

// Functionaly, `$lhs === $rhs` but avoids reference equality issues
// w/out having to introduce loose comparision ($lhs == $rhs works)
Expand Down
Loading