diff options
author | Donald Stufft <donald@stufft.io> | 2013-11-17 10:52:33 -0800 |
---|---|---|
committer | Donald Stufft <donald@stufft.io> | 2013-11-17 10:52:33 -0800 |
commit | 4a28d323b1227860da118a933d5f4940acaef999 (patch) | |
tree | e354636fdb891044548a3bb7042a253bfa97a616 /cryptography/hazmat/primitives/ciphers/algorithms.py | |
parent | 83e0e1f00224c1f995298226c2e0837d555af67c (diff) | |
parent | 0a394df31c4165d0230843ebea2717b3cd3caafa (diff) | |
download | cryptography-4a28d323b1227860da118a933d5f4940acaef999.tar.gz cryptography-4a28d323b1227860da118a933d5f4940acaef999.tar.bz2 cryptography-4a28d323b1227860da118a933d5f4940acaef999.zip |
Merge pull request #262 from dreid/cipher-algorithm-interfaces
Implement and document an interface for cipher algorithms
Diffstat (limited to 'cryptography/hazmat/primitives/ciphers/algorithms.py')
-rw-r--r-- | cryptography/hazmat/primitives/ciphers/algorithms.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cryptography/hazmat/primitives/ciphers/algorithms.py b/cryptography/hazmat/primitives/ciphers/algorithms.py index c135f563..1ed487b6 100644 --- a/cryptography/hazmat/primitives/ciphers/algorithms.py +++ b/cryptography/hazmat/primitives/ciphers/algorithms.py @@ -13,7 +13,10 @@ from __future__ import absolute_import, division, print_function +from cryptography.hazmat.primitives import interfaces + +@interfaces.register(interfaces.CipherAlgorithm) class AES(object): name = "AES" block_size = 128 @@ -33,6 +36,7 @@ class AES(object): return len(self.key) * 8 +@interfaces.register(interfaces.CipherAlgorithm) class Camellia(object): name = "camellia" block_size = 128 @@ -52,6 +56,7 @@ class Camellia(object): return len(self.key) * 8 +@interfaces.register(interfaces.CipherAlgorithm) class TripleDES(object): name = "3DES" block_size = 64 @@ -75,6 +80,7 @@ class TripleDES(object): return len(self.key) * 8 +@interfaces.register(interfaces.CipherAlgorithm) class Blowfish(object): name = "Blowfish" block_size = 64 @@ -94,6 +100,7 @@ class Blowfish(object): return len(self.key) * 8 +@interfaces.register(interfaces.CipherAlgorithm) class CAST5(object): name = "CAST5" block_size = 64 @@ -113,6 +120,7 @@ class CAST5(object): return len(self.key) * 8 +@interfaces.register(interfaces.CipherAlgorithm) class ARC4(object): name = "RC4" block_size = 1 |