fix "two-key 3des"-related things

(cherry picked from commit 715103a2038432d93537b0f0419717da4b9ee850)
This commit is contained in:
Steffen Jaeckel 2018-05-05 17:59:11 +02:00
parent 615b361673
commit 4c2ae4758e

View File

@ -36,7 +36,7 @@ const struct ltc_cipher_descriptor des3_desc =
{
"3des",
14,
24, 24, 8, 16,
16, 24, 8, 16,
&des3_setup,
&des3_ecb_encrypt,
&des3_ecb_decrypt,
@ -2068,8 +2068,11 @@ int des_keysize(int *keysize)
int des3_keysize(int *keysize)
{
LTC_ARGCHK(keysize != NULL);
if(*keysize < 24) {
if (*keysize < 16)
return CRYPT_INVALID_KEYSIZE;
if (*keysize < 24) {
*keysize = 16;
return CRYPT_OK;
}
*keysize = 24;
return CRYPT_OK;