MCPcopy
hub / github.com/pyca/cryptography / test_derive_point_at_infinity

Function test_derive_point_at_infinity

tests/hazmat/primitives/test_ec.py:141–157  ·  view source on GitHub ↗
(backend)

Source from the content-addressed store, hash-verified

139
140
141def test_derive_point_at_infinity(backend):
142 curve = ec.SECP256R1()
143 _skip_curve_unsupported(backend, curve)
144 # order of the curve
145 q = 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551
146 # BoringSSL rejects infinity points before it ever gets to us, so it
147 # uses a more generic error message.
148 match = (
149 "infinity"
150 if not (
151 rust_openssl.CRYPTOGRAPHY_IS_BORINGSSL
152 or rust_openssl.CRYPTOGRAPHY_IS_AWSLC
153 )
154 else "Invalid"
155 )
156 with pytest.raises(ValueError, match=match):
157 ec.derive_private_key(q, ec.SECP256R1())
158
159
160def test_derive_point_invalid_key(backend):

Callers

nothing calls this directly

Calls 1

_skip_curve_unsupportedFunction · 0.70

Tested by

no test coverage detected