comparison libtomcrypt/src/ciphers/des.c @ 1711:e9dba7abd939

Merge libtomcrypt v1.18.2
author Matt Johnston <matt@ucc.asn.au>
date Wed, 10 Jun 2020 23:16:13 +0800
parents 1ff2a1034c52
children
comparison
equal deleted inserted replaced
1710:1ff2a1034c52 1711:e9dba7abd939
36 36
37 const struct ltc_cipher_descriptor des3_desc = 37 const struct ltc_cipher_descriptor des3_desc =
38 { 38 {
39 "3des", 39 "3des",
40 14, 40 14,
41 24, 24, 8, 16, 41 16, 24, 8, 16,
42 &des3_setup, 42 &des3_setup,
43 &des3_ecb_encrypt, 43 &des3_ecb_encrypt,
44 &des3_ecb_decrypt, 44 &des3_ecb_decrypt,
45 &des3_test, 45 &des3_test,
46 &des3_done, 46 &des3_done,
2078 @return CRYPT_OK if the input key size is acceptable. 2078 @return CRYPT_OK if the input key size is acceptable.
2079 */ 2079 */
2080 int des3_keysize(int *keysize) 2080 int des3_keysize(int *keysize)
2081 { 2081 {
2082 LTC_ARGCHK(keysize != NULL); 2082 LTC_ARGCHK(keysize != NULL);
2083 if(*keysize < 24) { 2083 if (*keysize < 16)
2084 return CRYPT_INVALID_KEYSIZE; 2084 return CRYPT_INVALID_KEYSIZE;
2085 if (*keysize < 24) {
2086 *keysize = 16;
2087 return CRYPT_OK;
2085 } 2088 }
2086 *keysize = 24; 2089 *keysize = 24;
2087 return CRYPT_OK; 2090 return CRYPT_OK;
2088 } 2091 }
2089 2092