From patchwork Sat Jun 22 00:31:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 167451 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp1376875ilk; Fri, 21 Jun 2019 17:32:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpMRwYm0r0IUG4OntOFvlupCx9S28UCy2dFaKtMVzbYaDeU87AMIQiomZdQkK1TWQnwW1W X-Received: by 2002:a17:90a:de02:: with SMTP id m2mr10049309pjv.18.1561163534206; Fri, 21 Jun 2019 17:32:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561163534; cv=none; d=google.com; s=arc-20160816; b=b3ni3B5JOBxbglhBPOWBhhKZLQ5MOlCWHZDgDYW7IGuCGZ6zJ8hqYhnId74nJ+oCm0 zhm87CxJmtzI4d6eGhwBc1e9EVjAjOav37W79BUuLu9RjIuEeQnBdzGv4XUvC47C1Fhz 3hmK9bNfWo00BDuyjOX/jnPvRCxnFy73K6Wn7oOfFh+aPwR46irNF7ynh2fCLziu2+Cz RkiAG8dqkrIDEsD5Zgl5IYXBl3Sk0TdvMYrngEFt05UF0B6leReUDzPGY8iMWmOAJkNB fvE3SFkZqkSXlY8A82eZQHi6+ctkUS4ONc+NyulA2TgPwpEnoHLvM5XCaOeYla5Camzp iTjg== 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=CbGILY8ncRMp44ZG4GypjYJVSKRowL5JA0jxFG4yh4PpKFyUOCzdyTRsJgZheRaey3 i4ZVlpTnrbtz6hy2JQOi+Hqr815myfZKIp7uAKAaDzP+h3w/99njLVrkjtPy54WZ/KrE QIGAhP3AfhBmkw944mh/R5qF5fO22g4esbHfS2iI6PTzx1bqsY53YaCqPa9dInif/0F8 vzf+FUNkOONVelLarI/LtLX0wGkczCB97CTAX0d/bLKYV+cMZS/pDpFX3+TYwwqUWoOQ G6cYqHUlPXydflnze4p8pT4YA3tNCAyOaqKIK9LVpfMJQW1C/rA5FIKhSmkEeNfMbrU+ yFBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iPi8nc45; 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 v10si4096271plg.320.2019.06.21.17.32.14; Fri, 21 Jun 2019 17:32:14 -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=iPi8nc45; 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 S1726246AbfFVAcN (ORCPT + 3 others); Fri, 21 Jun 2019 20:32:13 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34629 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726237AbfFVAcN (ORCPT ); Fri, 21 Jun 2019 20:32:13 -0400 Received: by mail-wr1-f67.google.com with SMTP id k11so8144751wrl.1 for ; Fri, 21 Jun 2019 17:32:12 -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=iPi8nc45G1O5UoLYxlDzUR4fdl2tpSItDMz/Dr+rvbkBvg9zqZ4sNo/1JU69yl0OiU Gt1aKpxu2Pv3kUMm0eVdt5mPhmdc2LLF4Ql3QpXImq+rnMOBryPuKg4r3tzi2vF9+aTT c2KvnpiPtFbWLMkT3hOHQ9BZ4w8drzRQJuc3ysDWb3tHng6RDGPT3+ypSWhXKwXC6NRd JIcYmomeywsftvZogkuScilR2M+ap0xkgDitcksqyTEpxD+5Mz9JPz++6BZXNHD+gwDG sux2XrdfFwpJyolnaWQZwu9xa9qAxbhVjH5NYSiS7KNZQwLRTi+jn7JK7Q5nY7MV2Fwp Ki1Q== 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=K6JRl5R+br6DBCi4IVLDFvjRzZ7JobDael1laynAGVM0vQ0xgDin7mw0SXhBawcK8n ZciE6LuVdzlVuQQmQ/5VSwq31jGN8NXUBlPl5BHK9sOsqNEciagUNP6wYqxbU8M+i2ET iMQnx5bEm/sJaKC5P02naxpsfw1gQS5IYnCFxJGqOZkfsAOuegXWzyXVUoLp5x7ubEDp 3W+c5N38cLR2jK2f4QtyPVxcJ+UW1wHQTQd8frHye7Tep9xLQkT3hQG2z57yw1IHnMQC sRM4l0Q4BfuKygiaJF1dBzBS9vTfj1EbUhawCHP2P1yvlYaG2mVpxOioncLvD3VGa0UR Gzkw== X-Gm-Message-State: APjAAAUdXoVnPRGTYVWzuX1VFE2FrtfcqvFGimld24E79KeoKhBKcrDd E56p6o634dg1+RZp/8ZEDwMVnA2c9Bzmg4cq X-Received: by 2002:adf:fc45:: with SMTP id e5mr6733064wrs.240.1561163531312; Fri, 21 Jun 2019 17:32:11 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:99d4:1ff0:ed6:dfbb]) by smtp.gmail.com with ESMTPSA id v18sm4792019wrd.51.2019.06.21.17.32.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jun 2019 17:32:10 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, ebiggers@google.com, Ard Biesheuvel Subject: [RFC PATCH 26/30] crypto: des - remove unused function Date: Sat, 22 Jun 2019 02:31:08 +0200 Message-Id: <20190622003112.31033-27-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190622003112.31033-1-ard.biesheuvel@linaro.org> References: <20190622003112.31033-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);