summaryrefslogtreecommitdiff
path: root/cipher/cipher.c
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2012-01-11 13:20:48 +0100
committerWerner Koch <wk@gnupg.org>2012-02-16 20:45:46 +0100
commit318fd85f377c060908d371f792d41e599b3b7483 (patch)
tree4358f5f237a7f2039ddb914a3523aad7f6e452e6 /cipher/cipher.c
parent6078b05f5340d886e0b9e6cee1d9b5043e0cb210 (diff)
downloadlibgcrypt-318fd85f377c060908d371f792d41e599b3b7483.tar.gz
Add support for the IDEA cipher.
Adapt idea.c to the Libgcrypt framework. Add IDEA to cipher_table and to the build system. Patents on IDEA have expired: Europe: EP0482154 on 2011-05-16, Japan: JP3225440 on 2011-05-16, U.S.: 5,214,703 on 2012-01-07. * configure.ac: Add idea to the list of available ciphers. Define USE_IDEA if idea is enabled. * cipher/cipher.c (cipher_table): Add entry for IDEA. * cipher/idea.c: Update comment about patents. Include proper header files and remove redundant declarations. (expand_key, cipher, do_setkey, encrypt_block, decrypt_block): Define function arguments as const where appropriate. (cipher): Test for !WORDS_BIGENDIAN instead of LITTLE_ENDIAN_HOST. (do_setkey, decrypt_block): Don't call selftest. (idea_setkey): New function, wrapper for do_setkey. (idea_encrypt): New function, wrapper for encrypt_block. (_gcry_cipher_spec_idea): Define. * cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add idea.c. * src/cipher.h (_gcry_cipher_spec_idea): Declare. * tests/basic.c (check_ciphers): Add GCRY_CIPHER_IDEA.
Diffstat (limited to 'cipher/cipher.c')
-rw-r--r--cipher/cipher.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cipher/cipher.c b/cipher/cipher.c
index 589c262b..389bf7a6 100644
--- a/cipher/cipher.c
+++ b/cipher/cipher.c
@@ -100,6 +100,10 @@ static struct cipher_table_entry
{ &_gcry_cipher_spec_camellia256,
&dummy_extra_spec, GCRY_CIPHER_CAMELLIA256 },
#endif
+#ifdef USE_IDEA
+ { &_gcry_cipher_spec_idea,
+ &dummy_extra_spec, GCRY_CIPHER_IDEA },
+#endif
{ NULL }
};