(algorithm, expected_length)
| 101 | "algorithm, expected_length", ((ALGORITHMS.ES256, 32), (ALGORITHMS.ES384, 48), (ALGORITHMS.ES512, 66)) |
| 102 | ) |
| 103 | def 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…