From 3f906cc83affa04d678cb6bbfc39174f7c375bad Mon Sep 17 00:00:00 2001 From: Christophe Oosterlynck Date: Tue, 14 Oct 2008 22:31:55 +0200 Subject: [PATCH] padding added to test_doctests.py + little doc update in blockcipher.py --- src/CryptoPlus/Cipher/blockcipher.py | 4 ++++ test/test_doctests.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/CryptoPlus/Cipher/blockcipher.py b/src/CryptoPlus/Cipher/blockcipher.py index 0b3f086..e46cdba 100644 --- a/src/CryptoPlus/Cipher/blockcipher.py +++ b/src/CryptoPlus/Cipher/blockcipher.py @@ -432,6 +432,8 @@ class CTR: class XTS: """XTS Chaining Mode + + Usable with blockcihpers with a 16 byte blocksize """ # TODO: allow other blocksizes besides 16bytes? def __init__(self,codebook1, codebook2): @@ -513,6 +515,8 @@ class CMAC: Supports every cipher with a blocksize available in the list CMAC.supported_blocksizes. The hashlength is equal to block size of the used block cipher. + + Usable with blockcihpers with a 8 or 16 byte blocksize """ # TODO: move to hash module? # TODO: change update behaviour to .update() and .digest() as for all hash modules? diff --git a/test/test_doctests.py b/test/test_doctests.py index 06ba824..e311921 100644 --- a/test/test_doctests.py +++ b/test/test_doctests.py @@ -6,6 +6,7 @@ from pkg_resources import require require("CryptoPlus>=1.0") #import CryptoPlus.Cipher.python_AES from CryptoPlus.Cipher import python_AES, AES, python_DES, DES, python_DES3, DES3, python_Blowfish, Blowfish, python_Twofish, python_Serpent, python_Rijndael, CAST, ARC2, python_PRESENT +from CryptoPlus.Util import padding try: from CryptoPlus.Cipher import IDEA from CryptoPlus.Cipher import RC5 @@ -15,7 +16,7 @@ except ImportError: suite = unittest.TestSuite() #for mod in (CryptoPlus.Cipher.python_AES,CryptoPlus.Cipher.python_AES): -for mod in python_AES, AES, python_DES, DES, python_DES3, DES3, python_Blowfish, Blowfish, python_Twofish, python_Serpent, python_Rijndael, CAST, ARC2, python_PRESENT: +for mod in python_AES, AES, python_DES, DES, python_DES3, DES3, python_Blowfish, Blowfish, python_Twofish, python_Serpent, python_Rijndael, CAST, ARC2, python_PRESENT, padding: suite.addTest(doctest.DocTestSuite(mod)) if not import_error: suite.addTest(doctest.DocTestSuite(IDEA)) -- 2.11.4.GIT