aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2013-09-11 09:38:45 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2013-09-11 09:38:45 -0500
commita1ec262a3596dbba4ff82ff7d05c4f265f794359 (patch)
tree42a2b5a50611b58b25821aa80d71c7c6d469a749 /cryptography
parent9287c2344c6c91ad838a251d3b6fde2a6ea88b56 (diff)
downloadcryptography-a1ec262a3596dbba4ff82ff7d05c4f265f794359.tar.gz
cryptography-a1ec262a3596dbba4ff82ff7d05c4f265f794359.tar.bz2
cryptography-a1ec262a3596dbba4ff82ff7d05c4f265f794359.zip
CFB support
This requires a bit of explanation. OpenSSL has methods that implement standard CFB, 1-bit CFB (cfb1), and 8-bit CFB (cfb8). Unfortunately, while old (read: 0.9.7) versions of OpenSSL appear to test these variants, newer versions have a comment stating that cfb{1,8} are unsupported. Accordingly, I've backed out any support for the variants for now. We can add it back into the CFB class if and when we gain a backend that supports arbitrary s for 1 <= s <= block_size
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/primitives/block/modes.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/cryptography/primitives/block/modes.py b/cryptography/primitives/block/modes.py
index 62a1c2c9..0f17a1a5 100644
--- a/cryptography/primitives/block/modes.py
+++ b/cryptography/primitives/block/modes.py
@@ -36,5 +36,14 @@ class OFB(object):
self.nonce = nonce
+class CFB(object):
+ name = "CFB"
+
+ def __init__(self, initialization_vector):
+ super(CFB, self).__init__()
+ self.initialization_vector = initialization_vector
+
+
interfaces.ModeWithInitializationVector.register(CBC)
interfaces.ModeWithNonce.register(OFB)
+interfaces.ModeWithInitializationVector.register(CFB)