Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: des - remove unused function

Remove the old DES3 verification functions that are no longer used.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Ard Biesheuvel and committed by
Herbert Xu
6b5c4818 4fd4be05

-41
-41
include/crypto/des.h
··· 19 19 #define DES3_EDE_EXPKEY_WORDS (3 * DES_EXPKEY_WORDS) 20 20 #define DES3_EDE_BLOCK_SIZE DES_BLOCK_SIZE 21 21 22 - static inline int __des3_verify_key(u32 *flags, const u8 *key) 23 - { 24 - int err = -EINVAL; 25 - u32 K[6]; 26 - 27 - memcpy(K, key, DES3_EDE_KEY_SIZE); 28 - 29 - if (unlikely(!((K[0] ^ K[2]) | (K[1] ^ K[3])) || 30 - !((K[2] ^ K[4]) | (K[3] ^ K[5]))) && 31 - (fips_enabled || 32 - (*flags & CRYPTO_TFM_REQ_FORBID_WEAK_KEYS))) 33 - goto bad; 34 - 35 - if (unlikely(!((K[0] ^ K[4]) | (K[1] ^ K[5]))) && fips_enabled) 36 - goto bad; 37 - 38 - err = 0; 39 - 40 - out: 41 - memzero_explicit(K, DES3_EDE_KEY_SIZE); 42 - 43 - return err; 44 - 45 - bad: 46 - *flags |= CRYPTO_TFM_RES_WEAK_KEY; 47 - goto out; 48 - } 49 - 50 - static inline int des3_verify_key(struct crypto_skcipher *tfm, const u8 *key) 51 - { 52 - u32 flags; 53 - int err; 54 - 55 - flags = crypto_skcipher_get_flags(tfm); 56 - err = __des3_verify_key(&flags, key); 57 - crypto_skcipher_set_flags(tfm, flags); 58 - return err; 59 - } 60 - 61 - extern unsigned long des_ekey(u32 *pe, const u8 *k); 62 - 63 22 extern int __des3_ede_setkey(u32 *expkey, u32 *flags, const u8 *key, 64 23 unsigned int keylen); 65 24