Skip to content

Commit 90b15e6

Browse files
authored
feat(tests): add test case for P256 with Q at infinity (#2235)
Add a test case for the `p256verify` precompile with the input having public key (Q) as the point-at-infinity. If the implementation misses the check that Q is not at infinity, the signature should verify.
1 parent 4215632 commit 90b15e6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/osaka/eip7951_p256verify_precompiles/test_p256verify.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,17 @@ def test_valid(state_test: StateTestFiller, pre: Alloc, post: dict, tx: Transact
312312
),
313313
pytest.param(
314314
Spec.H0 + Spec.R0 + Spec.S0 + X(0) + Y(0),
315-
id="point_on_infinity",
315+
id="point_at_infinity",
316+
),
317+
# Test case with Q at infinity. If the implementation misses the check
318+
# that Q is not the point at infinity, the signature should verify.
319+
pytest.param(
320+
Spec.H0
321+
+ R(0x2DD5CBB0E37BAEC8D1460909B206CA2C87E50CA43B8F31E46168027A7F0AEEC6)
322+
+ Spec.S0
323+
+ X(0)
324+
+ Y(0),
325+
id="point_at_infinity_v2",
316326
),
317327
pytest.param(
318328
Spec.H0 + Spec.R0 + Spec.S0 + X(Spec.X0.value + 1) + Spec.Y0,

0 commit comments

Comments
 (0)