aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2018-03-15 13:35:10 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2018-03-15 13:35:10 -0400
commit17c8f126c7c7d5ce886112a6e924277a7b203f25 (patch)
treef6c136e76f4fe11243b2f43ef632c5893e0c8634 /src
parent2250aafd6f475a503219da75554200165005ee34 (diff)
downloadcryptography-17c8f126c7c7d5ce886112a6e924277a7b203f25.tar.gz
cryptography-17c8f126c7c7d5ce886112a6e924277a7b203f25.tar.bz2
cryptography-17c8f126c7c7d5ce886112a6e924277a7b203f25.zip
Brainpool curves (#4129)
* added brainpool ec-curves key_length >= 256bit * limit brainpool curves to the set that appear required + docs * oops * typos all around me * add brainpool ECDH kex tests * switch to using rfc 7027 vectors * review feedback * empty commits are the best
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/primitives/asymmetric/ec.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/primitives/asymmetric/ec.py b/src/cryptography/hazmat/primitives/asymmetric/ec.py
index 7931b086..83266bb4 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/ec.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/ec.py
@@ -228,6 +228,24 @@ class SECP192R1(object):
key_size = 192
+@utils.register_interface(EllipticCurve)
+class BrainpoolP256R1(object):
+ name = "brainpoolP256r1"
+ key_size = 256
+
+
+@utils.register_interface(EllipticCurve)
+class BrainpoolP384R1(object):
+ name = "brainpoolP384r1"
+ key_size = 384
+
+
+@utils.register_interface(EllipticCurve)
+class BrainpoolP512R1(object):
+ name = "brainpoolP512r1"
+ key_size = 512
+
+
_CURVE_TYPES = {
"prime192v1": SECP192R1,
"prime256v1": SECP256R1,
@@ -250,6 +268,10 @@ _CURVE_TYPES = {
"sect283r1": SECT283R1,
"sect409r1": SECT409R1,
"sect571r1": SECT571R1,
+
+ "brainpoolP256r1": BrainpoolP256R1,
+ "brainpoolP384r1": BrainpoolP384R1,
+ "brainpoolP512r1": BrainpoolP512R1,
}