Skip to content

test_wycheproof_invalid()

Documentation for tests/osaka/eip7951_p256verify_precompiles/test_p256verify.py::test_wycheproof_invalid@7b8124a7.

Generate fixtures for these test cases for Osaka with:

fill -v tests/osaka/eip7951_p256verify_precompiles/test_p256verify.py::test_wycheproof_invalid --fork Osaka

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

Source code in tests/osaka/eip7951_p256verify_precompiles/test_p256verify.py
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
@pytest.mark.parametrize(
    "input_data,expected_output,vector_gas_value",
    vectors_from_file("secp256r1_special_case_r_s.json")
    + vectors_from_file("secp256r1_modified_r_s.json"),
    # Test vectors generated from Wycheproof's ECDSA secp256r1 SHA-256
    # test suite, 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.Invalid()
@EIPChecklist.Precompile.Test.Inputs.MaxValues()
def test_wycheproof_invalid(
    state_test: StateTestFiller, pre: Alloc, post: dict, tx: Transaction
) -> None:
    """
    Test P256Verify precompile with Wycheproof test suite
    (invalid cases).
    """
    state_test(env=Environment(), pre=pre, post=post, tx=tx)

Parametrized Test Cases

This test generates 62 parametrized test cases across 1 fork.