From patchwork Tue Jul 2 19:41:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 168355 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4653400ilk; Tue, 2 Jul 2019 12:42:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiXdhaA1D+IB/0868Q4cvRMij3n/gYyZM46IZdp3Cu3WQtWyPxOMsAws4WN9Y+F3/+o4vA X-Received: by 2002:a63:e142:: with SMTP id h2mr4274431pgk.391.1562096545906; Tue, 02 Jul 2019 12:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562096545; cv=none; d=google.com; s=arc-20160816; b=VC+vsmOObMnuEwC1F91T7XMFJw3NA6ebvRZDujslLqCZCzx1C4Q03qLlhCeCfTBnVm LBBdxUWy3bqdb5MD27fUlDA3OHO2sarVZGb4nBaG9yhSrTAVneCILbKfmZ2CHjhvynGz ZHwA/41A+y4jbNki7MYhzFnBuNzBAjIcQXiUisY7ggxUSjWl8pvksANSYHbCSFC3h+yf TDpo8drz1rjiaqDl0pTIAoakPu6mCj/D1Ef+IuD6ttuBERygXRz544CDVR1wHWRZWZpg 3vm4JSaYML7NMOhwimuU0Tc9W8cD8I6H5jdgluqg3o1xQ7c444JB4wQF84o5lMrjW++9 4szA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=yr+3Q9TRlnFwRP1ePoUuE5UXQ0fVFG8IySkaq4i3ZqU=; b=J3WmKtRN8Ng1s/0aa19ClPSPwX3sjjLjYYe95GJLCThW09mM3YDvW7+hynwmHpVBB0 iQaKB0e06Euds9NXp4lsT7Ljcn8WZNXCKfmlywEBapDYv53JadqRjLxqNMI91/HTgT98 osGtubo6KIWP78aGYi4CHiAqIW14CvvQpTYWn4SyD3RD/sowUEsNAfyJE79SmvaBhlVj VbgOC2RzqyBcrL9MDXdLoZuhCPt2jMpAnd127lfTAsCFfgBuevj00CTSP7gj3bey8Ilc YjyWn5S5jw3Q7DwyQCv6Vjf+VrivhNzS3ileh6EGQwBluFbZmESXeha5bj8WuyhGZ7E0 eM5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="B/8h1V42"; 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 x13si13373092pgh.116.2019.07.02.12.42.25; Tue, 02 Jul 2019 12:42:25 -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="B/8h1V42"; 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 S1727055AbfGBTmZ (ORCPT + 3 others); Tue, 2 Jul 2019 15:42:25 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:38238 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726963AbfGBTmZ (ORCPT ); Tue, 2 Jul 2019 15:42:25 -0400 Received: by mail-lf1-f68.google.com with SMTP id b11so12267780lfa.5 for ; Tue, 02 Jul 2019 12:42:23 -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; bh=yr+3Q9TRlnFwRP1ePoUuE5UXQ0fVFG8IySkaq4i3ZqU=; b=B/8h1V42vB/KOIakIJ//DCOWkkqLanAZVkjURxJlw5bg+u8PUbrzmtBO6GRJggmRKJ TLBIOUmrqFJ6RZUZIV2SynJPPYI29sId4CH9q6ld2aYsS1WsTkIvViuuBCvMlbzGIQTX TCuOTE/G0OM9d9R1WfmDUF5m+JYoa+MYm1p5NEveAy3oAE6iqyrzQUXeycgHaJlRKgiu 8jyrGMP+QNILHIdrJZ33mpWlJxayjJwH08rPya/qVp7rlBj6bJHJyFs6aF9t9DHXs52X YkLhEZr5u1cmnQd5tkpbcprnHqG7fq30l2CJERsQkh4ZHFHksg4qXPtAKeczXizY3lH1 Q5ng== 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; bh=yr+3Q9TRlnFwRP1ePoUuE5UXQ0fVFG8IySkaq4i3ZqU=; b=PED8soIbi72WDp+q0rba7Hd8HKwAd7k49/+ed84LKZt0t8rjOT6/2xYRWo6PyFmr5m Rv+i22oLEavBqwdjH3Mb0C21HTh8c+TA0c5Uf/XIXu21ihKX3lLDWtHTYkjpLV0d1Z3L VSxMhjdtsEhPTIBEEXbEXhamS1XmAquxUVEss/ngyImNfS7eYdJGv+Pz0ujgB5QqkH90 /1nswsT0mG7Y54gbjSBLDG3DrGWm8VuW6WcNDmDUeN1CorWXm0JxJ5e54mjG0b7k06Do ploB63+AyKdamQHGtHHSLkwzH+HvRsbqY3fuiVB+Rd46lGvqBawzKF/yI9edcjJ/N/7+ PRKQ== X-Gm-Message-State: APjAAAWpkILwP2JVlzTPUNOIgK6z1tRjrh5piVcxQdJS01v9gbOkVL6d r7OV6hx28Usd+XQpLCcjeyO4ADY+Kbwi99/C X-Received: by 2002:ac2:4a78:: with SMTP id q24mr14501522lfp.59.1562096542780; Tue, 02 Jul 2019 12:42:22 -0700 (PDT) Received: from e111045-lin.arm.com (89-212-78-239.static.t-2.net. [89.212.78.239]) by smtp.gmail.com with ESMTPSA id 24sm4475163ljs.63.2019.07.02.12.42.21 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 12:42:21 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, ebiggers@google.com, Ard Biesheuvel Subject: [PATCH v4 09/32] crypto: safexcel/aes - switch to library version of key expansion routine Date: Tue, 2 Jul 2019 21:41:27 +0200 Message-Id: <20190702194150.10405-10-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190702194150.10405-1-ard.biesheuvel@linaro.org> References: <20190702194150.10405-1-ard.biesheuvel@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Switch to the new AES library that also provides an implementation of the AES key expansion routine. This removes the dependency on the generic AES cipher, allowing it to be omitted entirely in the future. Signed-off-by: Ard Biesheuvel --- drivers/crypto/Kconfig | 2 +- drivers/crypto/inside-secure/safexcel_cipher.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index fdccadc94819..b30b84089d11 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -718,7 +718,7 @@ config CRYPTO_DEV_SAFEXCEL tristate "Inside Secure's SafeXcel cryptographic engine driver" depends on OF depends on (ARM64 && ARCH_MVEBU) || (COMPILE_TEST && 64BIT) - select CRYPTO_AES + select CRYPTO_LIB_AES select CRYPTO_AUTHENC select CRYPTO_BLKCIPHER select CRYPTO_DES diff --git a/drivers/crypto/inside-secure/safexcel_cipher.c b/drivers/crypto/inside-secure/safexcel_cipher.c index 8cdbdbe35681..19ec086dce4f 100644 --- a/drivers/crypto/inside-secure/safexcel_cipher.c +++ b/drivers/crypto/inside-secure/safexcel_cipher.c @@ -178,7 +178,7 @@ static int safexcel_skcipher_aes_setkey(struct crypto_skcipher *ctfm, struct crypto_aes_ctx aes; int ret, i; - ret = crypto_aes_expand_key(&aes, key, len); + ret = aes_expandkey(&aes, key, len); if (ret) { crypto_skcipher_set_flags(ctfm, CRYPTO_TFM_RES_BAD_KEY_LEN); return ret;