Skip to content

test_wycheproof_extra()

Documentation for tests/osaka/eip7951_p256verify_precompiles/test_p256verify.py::test_wycheproof_extra@892e6d1e.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/osaka/eip7951_p256verify_precompiles/test_p256verify.py::test_wycheproof_extra --fork Amsterdam

Test P256Verify precompile with Wycheproof test suite (mixed valid/invalid cases).

Source code in tests/osaka/eip7951_p256verify_precompiles/test_p256verify.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@pytest.mark.parametrize(
    "input_data,expected_output,vector_gas_value",
    vectors_from_file("secp256r1_small_large_r_s.json")
    + vectors_from_file("secp256r1_special_points.json"),
    # Test vectors generated from Wycheproof's ECDSA secp256r1 SHA-256
    # test suite, valid/invalid cases
    # Source: https://github.com/C2SP/wycheproof/blob/main/
    # testvectors/ecdsa_secp256r1_sha256_test.json
)
@pytest.mark.parametrize("precompile_address", [Spec.P256VERIFY], ids=[""])
@EIPChecklist.Precompile.Test.CallContexts.Normal()
@EIPChecklist.Precompile.Test.Inputs.MaxValues()
def test_wycheproof_extra(
    state_test: StateTestFiller, pre: Alloc, post: dict, tx: Transaction
) -> None:
    """
    Test P256Verify precompile with Wycheproof test suite
    (mixed valid/invalid cases).
    """
    state_test(env=Environment(), pre=pre, post=post, tx=tx)

Parametrized Test Cases

This test generates 52 parametrized test cases across 2 forks.