aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-05-23 23:38:59 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2017-05-23 23:38:59 -0700
commit416f526a3d809d330b4a990bdf4a742384bde8f8 (patch)
tree93db904bb4dc50dd572d2cb4c54c0dee9bd12eb6 /tests
parent0517d1ae49061f486e2e4d279d70b6b61361de2f (diff)
downloadcryptography-416f526a3d809d330b4a990bdf4a742384bde8f8.tar.gz
cryptography-416f526a3d809d330b4a990bdf4a742384bde8f8.tar.bz2
cryptography-416f526a3d809d330b4a990bdf4a742384bde8f8.zip
add convenience methods for key_size on EC{Public,Private}Key (#3587)
Diffstat (limited to 'tests')
-rw-r--r--tests/hazmat/primitives/test_ec.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_ec.py b/tests/hazmat/primitives/test_ec.py
index ad4bbc51..d5db52ab 100644
--- a/tests/hazmat/primitives/test_ec.py
+++ b/tests/hazmat/primitives/test_ec.py
@@ -277,6 +277,15 @@ def test_ec_private_numbers_hash():
@pytest.mark.requires_backend_interface(interface=EllipticCurveBackend)
+def test_ec_key_key_size(backend):
+ curve = ec.SECP256R1()
+ _skip_curve_unsupported(backend, curve)
+ key = ec.generate_private_key(curve, backend)
+ assert key.key_size == 256
+ assert key.public_key().key_size == 256
+
+
+@pytest.mark.requires_backend_interface(interface=EllipticCurveBackend)
class TestECWithNumbers(object):
@pytest.mark.parametrize(
("vector", "hash_type"),