MCPcopy Create free account
hub / github.com/mpdavis/python-jose / test_cryptography_sig_component_length

Function test_cryptography_sig_component_length

tests/algorithms/test_EC.py:103–113  ·  view source on GitHub ↗
(algorithm, expected_length)

Source from the content-addressed store, hash-verified

101 "algorithm, expected_length", ((ALGORITHMS.ES256, 32), (ALGORITHMS.ES384, 48), (ALGORITHMS.ES512, 66))
102)
103def test_cryptography_sig_component_length(algorithm, expected_length):
104 # Put mapping inside here to avoid more complex handling for test runs that do not have pyca/cryptography
105 mapping = {
106 ALGORITHMS.ES256: CryptographyEc.SECP256R1,
107 ALGORITHMS.ES384: CryptographyEc.SECP384R1,
108 ALGORITHMS.ES512: CryptographyEc.SECP521R1,
109 }
110 key = CryptographyECKey(
111 CryptographyEc.generate_private_key(mapping[algorithm](), backend=CryptographyBackend()), algorithm
112 )
113 assert key._sig_component_length() == expected_length
114
115
116@pytest.mark.cryptography

Callers

nothing calls this directly

Calls 2

_sig_component_lengthMethod · 0.95
CryptographyECKeyClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…