Skip to content

test_isogeny_kernel_values()

Documentation for tests/prague/eip2537_bls_12_381_precompiles/test_bls12_map_fp_to_g1.py::test_isogeny_kernel_values@892e6d1e.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/prague/eip2537_bls_12_381_precompiles/test_bls12_map_fp_to_g1.py::test_isogeny_kernel_values --fork Amsterdam

Test the BLS12_MAP_FP_TO_G1 precompile with isogeny kernel inputs.

The isogeny kernel is simply the set of special field values, that after the two step mapping (first SWU onto an auxiliary curve, then an 11-degree isogeny back to G1), collapse exactly to the identity point.

Please proceed to the generator in helpers.py to see how the isogeny kernel values are generated.

Source code in tests/prague/eip2537_bls_12_381_precompiles/test_bls12_map_fp_to_g1.py
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
@pytest.mark.parametrize("expected_output", [Spec.INF_G1], ids=[""])
@pytest.mark.parametrize(
    "input_data,vector_gas_value",
    [
        pytest.param(t, None, id=f"isogeny_kernel_{i}")
        for i, t in enumerate(G1_FIELD_POINTS_MAP_TO_IDENTITY)
    ],
)
def test_isogeny_kernel_values(
    state_test: StateTestFiller,
    pre: Alloc,
    post: dict,
    tx: Transaction,
) -> None:
    """
    Test the BLS12_MAP_FP_TO_G1 precompile with isogeny kernel inputs.

    The isogeny kernel is simply the set of special field values, that after
    the two step mapping (first SWU onto an auxiliary curve, then an 11-degree
    isogeny back to G1), collapse exactly to the identity point.

    Please proceed to the generator in `helpers.py` to see how the isogeny
    kernel values are generated.
    """
    state_test(
        env=Environment(),
        pre=pre,
        tx=tx,
        post=post,
    )

Parametrized Test Cases

This test generates 8 parametrized test cases across 3 forks.