diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-10-23 07:51:27 -0700 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-10-23 07:51:27 -0700 |
commit | 40ebc39944af3b0fea29454f68327a9c56fcf2f1 (patch) | |
tree | f3dc5fb03b291e099fe619289abdfa8839f150af | |
parent | 64375de80eb5573ce451dc91e208eb8be3933936 (diff) | |
parent | b79f3ee0bbc98cb44714db9c01605666747a9751 (diff) | |
download | cryptography-40ebc39944af3b0fea29454f68327a9c56fcf2f1.tar.gz cryptography-40ebc39944af3b0fea29454f68327a9c56fcf2f1.tar.bz2 cryptography-40ebc39944af3b0fea29454f68327a9c56fcf2f1.zip |
Merge pull request #1428 from alex/shorten-ec
Simplify the implementation of the EC curve keys
-rw-r--r-- | cryptography/hazmat/primitives/asymmetric/ec.py | 135 |
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 = { |