From patchwork Thu Jun 27 12:03:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 167953 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2250025ilk; Thu, 27 Jun 2019 05:04:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9qpNF2C7QiKaZXWLq2xwbJRiqWVF7frD40RKxwPgl+f0JMd6B5Xr3wTHtOG2ikt/vLmcJ X-Received: by 2002:a17:90a:24ac:: with SMTP id i41mr5613513pje.124.1561637040299; Thu, 27 Jun 2019 05:04:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561637040; cv=none; d=google.com; s=arc-20160816; b=YOmMHCdf6Bf95axpQbXbCbqhSjxr538bkBnuUEZO8IpgjqcBmACNVeZV8c8Xo/8tEB tpIUeaMx+oKX22kLzjZyUwbRdt923Rt9G/adi3VpjiyD4VLGi7DY8Bs3ulQ3jhYGUUc0 lCgKYT9SDWD/3uGUM4marNDhlfyNiBVMecNX53bckUyLGEy4/H51bFrSMtt3YSgaRcbD Gd8oBvOpqmrSJYDed7HmwEv6PysGorZzesE/Bb3UKH1cHMlN5qc6GSFUqQGbl/3WSl11 VAmE2G8vjHNB3+qKGmVZY2UaBlSXrspsMIx0HVcnSnKcVC75BpT6KlSW2P+RblWgHnAn RgNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GlTPPuF7VX+eSXKr9xKNOwcbjbSTX6Pw4/5JxljOKbg=; b=fkUeTHB5uAILqS6QVf4B5BT7qsIPmB21o7BxEfOtFYieCEZqd/GaC+v5XaqWDZ/m6c 0h3SOJ7dWlzXOefwa6AwbjiEVBCAmhkyXNpvruU2feFdwLFbdpNJyUHPqgFl1MnPx56y y2/66mVxOSPJ88zkC/4YIQky0xADVp591muNGuldj8Yob5chs+u/zlSoGSPDj0H5fELQ 7Shhf1iMxhgPBnmENR0zym0SWvDKn1DyYPgEctVNawJX46/ILAy4ff0k0b9fjViboxVS 6sbI18/H0l6O+oA1Sd2E3OHb2L/T1pbCugBeoUZzhYNGA6cgbCDNbT9ZJwxEjvz8CZBp dT9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="OMfsU/JS"; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f72si2632585pfa.67.2019.06.27.05.04.00; Thu, 27 Jun 2019 05:04:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="OMfsU/JS"; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726906AbfF0MD7 (ORCPT + 3 others); Thu, 27 Jun 2019 08:03:59 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:52430 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726876AbfF0MD5 (ORCPT ); Thu, 27 Jun 2019 08:03:57 -0400 Received: by mail-wm1-f67.google.com with SMTP id s3so5468462wms.2 for ; Thu, 27 Jun 2019 05:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GlTPPuF7VX+eSXKr9xKNOwcbjbSTX6Pw4/5JxljOKbg=; b=OMfsU/JSW0SMZatZZnAJHpMGi3CUDPeclFT1aeZiYANbvksi3yWKt1kKFJrIaUhYvl mhS2oNAu33hK8o9oU/6hy/z0NGoq4MCKkPnVYRcTi/uWKnZWjbQ7sOdycFY/MuUbRIMg v55kEg1lsf7WkRrG8CaCu7r32gxlECR27jokVcPMG197u/vhdGNip9B6cA7s62rfM+P4 1lTvLVKMQEz1RpiJUR64IzGvKu75SCo/FlJFIwLhLCcJ7A/Fxe2T1zwrKku3mY+AP8+X zghFAKEBVOEOpgV4sUKxAWeTPf/ZJCvnNfSyRRuL3ig3jkwN4WVizDZTMXS7XLL7N4OR 8Yng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GlTPPuF7VX+eSXKr9xKNOwcbjbSTX6Pw4/5JxljOKbg=; b=HKRbq6JfHTqpWxcpyinvPMjBfhIQsNrcpdaLkcgLdToGiZrNF4kio4trGSCuq9DY2a ODQmAA3TSFOpJCm6XxcvIysp1Kwknzpj5JNgYs29neK+qo9FT1NXocIZAe3voefaJRAb MBdFsJ8HZPkaj2xaa4XBUSD+tOD6mQ0FQ8HMlSkj3XQdygdLwwWjvWnh4fPzXiw5Iw/C 7wDDtj/40vbaU41wJJgg9OPVKMIknhhBhNfAN5FzYtnFWUWaYhPOWMGSZALrPZ+an+tU aMa4j/RXl4tZPy2w6ApZvv8S4BTeR8VFTAoPtvXsxmIVYsFqmOQHpLOewURytLLXwNTk OQUA== X-Gm-Message-State: APjAAAUwlrCgWUOs7tWIJD0D/LKaEzpwu30JVorgUNpBzSO4CUBkVitP nrnnYEhefPV5lK5B5KCSw/ND1VojGvTyOQ== X-Received: by 2002:a1c:2907:: with SMTP id p7mr2980719wmp.100.1561637034837; Thu, 27 Jun 2019 05:03:54 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-657-1-83-120.w92-154.abo.wanadoo.fr. [92.154.90.120]) by smtp.gmail.com with ESMTPSA id z126sm7732431wmb.32.2019.06.27.05.03.53 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 27 Jun 2019 05:03:54 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, ebiggers@kernel.org, horia.geanta@nxp.com, Ard Biesheuvel Subject: [PATCH v2 26/30] crypto: des - remove unused function Date: Thu, 27 Jun 2019 14:03:10 +0200 Message-Id: <20190627120314.7197-27-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190627120314.7197-1-ard.biesheuvel@linaro.org> References: <20190627120314.7197-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Remove the old DES3 verification functions that are no longer used. Signed-off-by: Ard Biesheuvel --- include/crypto/des.h | 41 -------------------- 1 file changed, 41 deletions(-) -- 2.20.1 diff --git a/include/crypto/des.h b/include/crypto/des.h index 72c7c8e5a5a7..31b04ba835b1 100644 --- a/include/crypto/des.h +++ b/include/crypto/des.h @@ -19,47 +19,6 @@ #define DES3_EDE_EXPKEY_WORDS (3 * DES_EXPKEY_WORDS) #define DES3_EDE_BLOCK_SIZE DES_BLOCK_SIZE -static inline int __des3_verify_key(u32 *flags, const u8 *key) -{ - int err = -EINVAL; - u32 K[6]; - - memcpy(K, key, DES3_EDE_KEY_SIZE); - - if (unlikely(!((K[0] ^ K[2]) | (K[1] ^ K[3])) || - !((K[2] ^ K[4]) | (K[3] ^ K[5]))) && - (fips_enabled || - (*flags & CRYPTO_TFM_REQ_FORBID_WEAK_KEYS))) - goto bad; - - if (unlikely(!((K[0] ^ K[4]) | (K[1] ^ K[5]))) && fips_enabled) - goto bad; - - err = 0; - -out: - memzero_explicit(K, DES3_EDE_KEY_SIZE); - - return err; - -bad: - *flags |= CRYPTO_TFM_RES_WEAK_KEY; - goto out; -} - -static inline int des3_verify_key(struct crypto_skcipher *tfm, const u8 *key) -{ - u32 flags; - int err; - - flags = crypto_skcipher_get_flags(tfm); - err = __des3_verify_key(&flags, key); - crypto_skcipher_set_flags(tfm, flags); - return err; -} - -extern unsigned long des_ekey(u32 *pe, const u8 *k); - extern int __des3_ede_setkey(u32 *expkey, u32 *flags, const u8 *key, unsigned int keylen);