diff options
author | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2009-10-08 21:07:01 -0400 |
---|---|---|
committer | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2009-10-10 17:07:23 -0400 |
commit | 9626436369aa5ae3d19598d42b34f9a1f87d830d (patch) | |
tree | 3fcf114b0b847e50b2017681f8e144e941dde62b | |
parent | cdbe42a106cbcb622fd039ec7a9ff5f4737a1c4a (diff) | |
download | pycrypto-9626436369aa5ae3d19598d42b34f9a1f87d830d.tar.gz |
Remove dead code related to IDEA and RC5
-rw-r--r-- | lib/Crypto/Cipher/__init__.py | 4 | ||||
-rw-r--r-- | src/block_template.c | 37 |
2 files changed, 1 insertions, 40 deletions
diff --git a/lib/Crypto/Cipher/__init__.py b/lib/Crypto/Cipher/__init__.py index 874a299..d8ceed9 100644 --- a/lib/Crypto/Cipher/__init__.py +++ b/lib/Crypto/Cipher/__init__.py @@ -38,13 +38,11 @@ Crypto.Cipher.CAST Crypto.Cipher.DES The Data Encryption Standard. Very commonly used in the past, but today its 56-bit keys are too small. Crypto.Cipher.DES3 Triple DES. -Crypto.Cipher.IDEA -Crypto.Cipher.RC5 Crypto.Cipher.XOR The simple XOR cipher. """ __all__ = ['AES', 'ARC2', 'ARC4', - 'Blowfish', 'CAST', 'DES', 'DES3', 'IDEA', 'RC5', + 'Blowfish', 'CAST', 'DES', 'DES3', 'XOR' ] diff --git a/src/block_template.c b/src/block_template.c index 92a879b..d54b59b 100644 --- a/src/block_template.c +++ b/src/block_template.c @@ -99,9 +99,6 @@ static char ALGnew__doc__[] = "new(key, [mode], [IV]): Return a new " _MODULE_STRING " encryption object."; static char *kwlist[] = {"key", "mode", "IV", "counter", "segment_size", -#ifdef PCT_RC5_MODULE - "version", "word_size", "rounds", -#endif #ifdef PCT_ARC2_MODULE "effective_keylen", #endif @@ -115,26 +112,17 @@ ALGnew(PyObject *self, PyObject *args, PyObject *kwdict) int keylen, IVlen=0, mode=MODE_ECB, segment_size=0; PyObject *counter = NULL; int counter_shortcut = 0; -#ifdef PCT_RC5_MODULE - int version = 0x10, word_size = 32, rounds = 16; /*XXX default rounds? */ -#endif #ifdef PCT_ARC2_MODULE int effective_keylen = 1024; /* this is a weird default, but it's compatible with old versions of PyCrypto */ #endif /* Set default values */ if (!PyArg_ParseTupleAndKeywords(args, kwdict, "s#|is#Oi" -#ifdef PCT_RC5_MODULE - "iii" -#endif #ifdef PCT_ARC2_MODULE "i" #endif , kwlist, &key, &keylen, &mode, &IV, &IVlen, &counter, &segment_size -#ifdef PCT_RC5_MODULE - , &version, &word_size, &rounds -#endif #ifdef PCT_ARC2_MODULE , &effective_keylen #endif @@ -202,26 +190,6 @@ ALGnew(PyObject *self, PyObject *args, PyObject *kwdict) } /* Cipher-specific checks */ -#ifdef PCT_RC5_MODULE - if (version!=0x10) { - PyErr_Format(PyExc_ValueError, - "RC5: Bad RC5 algorithm version: %i", - version); - return NULL; - } - if (word_size!=16 && word_size!=32) { - PyErr_Format(PyExc_ValueError, - "RC5: Unsupported word size: %i", - word_size); - return NULL; - } - if (rounds<0 || MAX_RC5_ROUNDS<rounds) { - PyErr_Format(PyExc_ValueError, - "RC5: rounds must be between 0 and %u, not %i", - MAX_RC5_ROUNDS, rounds); - return NULL; - } -#endif #ifdef PCT_ARC2_MODULE if (effective_keylen<0 || effective_keylen>1024) { PyErr_Format(PyExc_ValueError, @@ -237,11 +205,6 @@ ALGnew(PyObject *self, PyObject *args, PyObject *kwdict) new->counter = counter; Py_XINCREF(counter); new->counter_shortcut = counter_shortcut; -#ifdef PCT_RC5_MODULE - new->st.version = version; - new->st.word_size = word_size; - new->st.rounds = rounds; -#endif #ifdef PCT_ARC2_MODULE new->st.effective_keylen = effective_keylen; #endif |