aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-10-22 10:15:06 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2014-10-22 10:15:06 -0700
commitb79f3ee0bbc98cb44714db9c01605666747a9751 (patch)
treead330d6d2bd88286f8a0eb536aba05017d1ceb36
parent60d8640bc3aa8eb48273e1df6de94607a38f8ec3 (diff)
downloadcryptography-b79f3ee0bbc98cb44714db9c01605666747a9751.tar.gz
cryptography-b79f3ee0bbc98cb44714db9c01605666747a9751.tar.bz2
cryptography-b79f3ee0bbc98cb44714db9c01605666747a9751.zip
Simplify the implementation of the EC curve keys
-rw-r--r--cryptography/hazmat/primitives/asymmetric/ec.py135
1 files changed, 30 insertions, 105 deletions
diff --git a/cryptography/hazmat/primitives/asymmetric/ec.py b/cryptography/hazmat/primitives/asymmetric/ec.py
index b27d0458..ced732fb 100644
--- a/cryptography/hazmat/primitives/asymmetric/ec.py
+++ b/cryptography/hazmat/primitives/asymmetric/ec.py
@@ -21,167 +21,92 @@ from cryptography.hazmat.primitives import interfaces
@utils.register_interface(interfaces.EllipticCurve)
class SECT571R1(object):
- @property
- def name(self):
- return "sect571r1"
-
- @property
- def key_size(self):
- return 571
+ name = "sect571r1"
+ key_size = 571
@utils.register_interface(interfaces.EllipticCurve)
class SECT409R1(object):
- @property
- def name(self):
- return "sect409r1"
-
- @property
- def key_size(self):
- return 409
+ name = "sect409r1"
+ key_size = 409
@utils.register_interface(interfaces.EllipticCurve)
class SECT283R1(object):
- @property
- def name(self):
- return "sect283r1"
-
- @property
- def key_size(self):
- return 283
+ name = "sect283r1"
+ key_size = 283
@utils.register_interface(interfaces.EllipticCurve)
class SECT233R1(object):
- @property
- def name(self):
- return "sect233r1"
-
- @property
- def key_size(self):
- return 233
+ name = "sect233r1"
+ key_size = 233
@utils.register_interface(interfaces.EllipticCurve)
class SECT163R2(object):
- @property
- def name(self):
- return "sect163r2"
-
- @property
- def key_size(self):
- return 163
+ name = "sect163r2"
+ key_size = 163
@utils.register_interface(interfaces.EllipticCurve)
class SECT571K1(object):
- @property
- def name(self):
- return "sect571k1"
-
- @property
- def key_size(self):
- return 571
+ name = "sect571k1"
+ key_size = 571
@utils.register_interface(interfaces.EllipticCurve)
class SECT409K1(object):
- @property
- def name(self):
- return "sect409k1"
-
- @property
- def key_size(self):
- return 409
+ name = "sect409k1"
+ key_size = 409
@utils.register_interface(interfaces.EllipticCurve)
class SECT283K1(object):
- @property
- def name(self):
- return "sect283k1"
-
- @property
- def key_size(self):
- return 283
+ name = "sect283k1"
+ key_size = 283
@utils.register_interface(interfaces.EllipticCurve)
class SECT233K1(object):
- @property
- def name(self):
- return "sect233k1"
-
- @property
- def key_size(self):
- return 233
+ name = "sect233k1"
+ key_size = 233
@utils.register_interface(interfaces.EllipticCurve)
class SECT163K1(object):
- @property
- def name(self):
- return "sect163k1"
-
- @property
- def key_size(self):
- return 163
+ name = "sect163k1"
+ key_size = 163
@utils.register_interface(interfaces.EllipticCurve)
class SECP521R1(object):
- @property
- def name(self):
- return "secp521r1"
-
- @property
- def key_size(self):
- return 521
+ name = "secp521r1"
+ key_size = 521
@utils.register_interface(interfaces.EllipticCurve)
class SECP384R1(object):
- @property
- def name(self):
- return "secp384r1"
-
- @property
- def key_size(self):
- return 384
+ name = "secp384r1"
+ key_size = 384
@utils.register_interface(interfaces.EllipticCurve)
class SECP256R1(object):
- @property
- def name(self):
- return "secp256r1"
-
- @property
- def key_size(self):
- return 256
+ name = "secp256r1"
+ key_size = 256
@utils.register_interface(interfaces.EllipticCurve)
class SECP224R1(object):
- @property
- def name(self):
- return "secp224r1"
-
- @property
- def key_size(self):
- return 224
+ name = "secp224r1"
+ key_size = 224
@utils.register_interface(interfaces.EllipticCurve)
class SECP192R1(object):
- @property
- def name(self):
- return "secp192r1"
-
- @property
- def key_size(self):
- return 192
+ name = "secp192r1"
+ key_size = 192
_CURVE_TYPES = {