From 0178a6d33ff6afc7d0305619d3d250235ae55d09 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sat, 27 Sep 2014 16:04:07 +0200 Subject: Optimize code space and solve the Serpent issue (https://sourceforge.net/p/veracrypt/discussion/technical/thread/fb09633a/#6406) by removing key length parameter from serpent_set_key and twofish_set_key --- src/Common/Crypto.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Common') diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c index f57bea44..a63bc954 100644 --- a/src/Common/Crypto.c +++ b/src/Common/Crypto.c @@ -119,11 +119,11 @@ int CipherInit (int cipher, unsigned char *key, unsigned __int8 *ks) break; case SERPENT: - serpent_set_key (key, CipherGetKeySize(SERPENT) * 8, ks); + serpent_set_key (key, ks); break; case TWOFISH: - twofish_set_key ((TwofishInstance *)ks, (const u4byte *)key, CipherGetKeySize(TWOFISH) * 8); + twofish_set_key ((TwofishInstance *)ks, (const u4byte *)key); break; default: @@ -972,9 +972,9 @@ int EAInit (int ea, unsigned char *key, unsigned __int8 *ks) return ERR_CIPHER_INIT_FAILURE; #elif defined (TC_WINDOWS_BOOT_SERPENT) - serpent_set_key (key, 32 * 8, ks); + serpent_set_key (key, ks); #elif defined (TC_WINDOWS_BOOT_TWOFISH) - twofish_set_key ((TwofishInstance *)ks, (const u4byte *)key, 32 * 8); + twofish_set_key ((TwofishInstance *)ks, (const u4byte *)key); #endif return ERR_SUCCESS; } -- cgit v1.2.3