Skip to content

Commit 7152202

Browse files
authored
feat(tests): add more tests for P256 where R is at infinity (#2238)
Add more tests cases for the `p256verify` precompile where the final computed point `R` is at infinity by passing `Q = -G` and `u1 == u2`. Similar test cases exist in "wycheproof_extra".
1 parent b2a3558 commit 7152202

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Test fixtures for use by clients are available for each release on the [Github r
3434

3535
- ✨ Add safe EIP-6110 workaround to allow Geth/Reth to pass invalid deposit request tests even thought they are out of spec ([#2177](https://github.com/ethereum/execution-spec-tests/pull/2177), [#2233](https://github.com/ethereum/execution-spec-tests/pull/2233)).
3636
- ✨ Add an EIP-7928 test case targeting the `SELFDESTRUCT` opcode. ([#2159](https://github.com/ethereum/execution-spec-tests/pull/2159)).
37+
- ✨ Add essential tests for coverage gaps in EIP-7951 (`p256verify` precompile) ([#2179](https://github.com/ethereum/execution-spec-tests/pull/2159), [#2203](https://github.com/ethereum/execution-spec-tests/pull/2203), [#2215](https://github.com/ethereum/execution-spec-tests/pull/2215), [#2216](https://github.com/ethereum/execution-spec-tests/pull/2216), [#2217](https://github.com/ethereum/execution-spec-tests/pull/2217), [#2218](https://github.com/ethereum/execution-spec-tests/pull/2218), [#2221](https://github.com/ethereum/execution-spec-tests/pull/2221), [#2229](https://github.com/ethereum/execution-spec-tests/pull/2229), [#2230](https://github.com/ethereum/execution-spec-tests/pull/2230), [#2237](https://github.com/ethereum/execution-spec-tests/pull/2237), [#2238](https://github.com/ethereum/execution-spec-tests/pull/2238)).
3738

3839
## [v5.0.0](https://github.com/ethereum/execution-spec-tests/releases/tag/v5.0.0) - 2025-09-05
3940

tests/osaka/eip7951_p256verify_precompiles/test_p256verify.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,16 @@ def test_valid(state_test: StateTestFiller, pre: Alloc, post: dict, tx: Transact
344344
Spec.H0 + Spec.R0 + Spec.S0 + X(Spec.P + 1) + Spec.Y0,
345345
id="x_greater_than_p",
346346
),
347+
# Test case produces the point R at infinity: (R0/S0)*G + (R0/S0)*(-G).
348+
pytest.param(
349+
H(Spec.R0.value) + Spec.R0 + Spec.S0 + X(Spec.Gx) + Y(Spec.P - Spec.Gy),
350+
id="R_at_infinity_v1",
351+
),
352+
# Test case produces the point R at infinity: (1/1)*G + (1/1)*(-G).
353+
pytest.param(
354+
H(1) + R(1) + S(1) + X(Spec.Gx) + Y(Spec.P - Spec.Gy),
355+
id="R_at_infinity_v2",
356+
),
347357
pytest.param(
348358
Spec.H0
349359
+ R(0x813EF79CCEFA9A56F7BA805F0E478584FE5F0DD5F567BC09B5123CCBC9832365)

0 commit comments

Comments
 (0)