Skip to content

Commit a5f0b21

Browse files
authored
feat(tests): add test case for P256 where Q.x is zero (#2221)
The P256 curve has two points with `x` coordinate being `0` (and none points with `y` being `0`). Add two positive test cases where the points with `0` x-coordinate are public keys.
1 parent 9821d2e commit a5f0b21

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/osaka/eip7951_p256verify_precompiles/test_p256verify.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,22 @@ def test_wycheproof_extra(state_test: StateTestFiller, pre: Alloc, post: dict, t
124124
+ Y(Spec.Gy),
125125
id="hash_max",
126126
),
127+
pytest.param(
128+
H(0xC3D3BE9EB3577F217AE0AB360529A30B18ADC751AEC886328593D7D6FE042809)
129+
+ R(0x3A4E97B44CBF88B90E6205A45BA957E520F63F3C6072B53C244653278A1819D8)
130+
+ S(0x6A184AA037688A5EBD25081FD2C0B10BB64FA558B671BD81955CA86E09D9D722)
131+
+ X(0)
132+
+ Y(0x66485C780E2F83D72433BD5D84A06BB6541C2AF31DAE871728BF856A174F93F4),
133+
id="x_0_y_positive",
134+
),
135+
pytest.param(
136+
H(0xF98A88895CB0866C5BAD58CF03000DDF9D21CB9407892FF54D637E6A046AFBB3)
137+
+ R(0x81DC074973D3222F3930981AD98D022517C91063FFB83CFD620E29B86DC30A8F)
138+
+ S(0x365E4CD085617A265765062A2D9954ED86309DFA33CF5AE1464FE119419FC34A)
139+
+ X(0)
140+
+ Y(0x99B7A386F1D07C29DBCC42A27B5F9449ABE3D50DE25178E8D7407A95E8B06C0B),
141+
id="x_0_y_negative",
142+
),
127143
],
128144
)
129145
@pytest.mark.parametrize("expected_output", [Spec.SUCCESS_RETURN_VALUE], ids=[""])

0 commit comments

Comments
 (0)