From patchwork Tue Jul 2 19:41:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 168357 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4653445ilk; Tue, 2 Jul 2019 12:42:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzz9M+TOjlp44qHmK7dB4C/4Sst/CHnakxh+41F59vHMorkPltFHYVg9sv+QrLnaMj2uyAQ X-Received: by 2002:a17:902:1003:: with SMTP id b3mr37620553pla.172.1562096548739; Tue, 02 Jul 2019 12:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562096548; cv=none; d=google.com; s=arc-20160816; b=SNPZeG+AlftK01F8tVr4GGfvxBu1RSdtYPw0W7079X7tpCzBfB3bxjaXLmmgmfO+fc /oBNIjJ4dqWS7ATH87EsjQfwIPvEqa4GVArt2KtMs7GNNFUk6l4S9VHWSFEhkLNSq1zR HvYjfX39uCkB7r7LKj3/r36BnLBL177qUlJMI6XJGjLaSidV2xynGwcQ89yW03brNBr8 /8d2+ZeLQizhNAEPA5atQs1KguvB97sd2evwm3BwdFl2ik3AQertk9nlg5CEvnpixvsC j0tOn3FHHoleoqnYVg8t5qGv8l+whMF8F5CiKpzJ626ak80AxO3lyblM6/SYSA6Ig+/u lp7g== 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=mFytONJYgeLPEAdaeV/79gIWsnl1yOK0v5PQmjMRL3M=; b=KITMPZ2bCpOS8vJtTJRkxg7vbJBirvbQsO+bhP/pSd+x2zcMty5sdjRpcQuE+oHYN6 AQWdcYWUGWemc2oelmuHn73e3BTlfyJE+sw/sXTSbMPNBDm21ygTFzvO9zAVTYrv+5qH imBKL1pDseH6IcxgUFV+UcYHACmixxe1oD1tSJsXlxpK5bda4690d8j6NQzAUsBFdiSc BOk31HcBUpAECqInBIx/Qz8gtp5pbFX7e4Jcp7fGF4Yy9/NMYxkYY87DjdqBHj0jQT/Q 977yAxYDZQMiT5b+BDIurpcuc95nOshEKmuZrs0v6BTKO7Rjr1/MwL+htBtBhib/GxVi akgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nWgAdFGp; 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.28; Tue, 02 Jul 2019 12:42:28 -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=nWgAdFGp; 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 S1727065AbfGBTm2 (ORCPT + 3 others); Tue, 2 Jul 2019 15:42:28 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:40012 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbfGBTm1 (ORCPT ); Tue, 2 Jul 2019 15:42:27 -0400 Received: by mail-lf1-f66.google.com with SMTP id a9so12297007lff.7 for ; Tue, 02 Jul 2019 12:42:26 -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=mFytONJYgeLPEAdaeV/79gIWsnl1yOK0v5PQmjMRL3M=; b=nWgAdFGpodhwE7+93cpf8hVe5RVv3EzevLafUKHyHxj2qLtuO7g3rMpYF0Uc8G7EST xMlgMgsEIl9/8rIwSbK7RP/Ectctkb0o4dvaDxowAW+yfl5CDlp7wsUO5gVjpFYJlf36 bQkN76++aoAlH/rYuZKwb9fGGb5Xio/JnxFethzXtBrCPKmxrKOCRovjmDdj8AV1UlD/ 9m49x0JXosLMzeaUjP+LeM2IKR8/pgOeIdy9A3lf7oKkTphUG5Z3JbH6yMxNQBBz0zfJ X2mFysrmK7dh/g3FZWhi9stGL3ymth+ae/D2x38j7jMy5Cp/tAu+xxqtiidLAaDjuhh0 FJWQ== 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=mFytONJYgeLPEAdaeV/79gIWsnl1yOK0v5PQmjMRL3M=; b=sarS+xCxMhRJaTCVJuBnR0A0FQ813awpxmNS46Z01O1nL28CeBWzz3JRCs8GVS8Sha pG/63ppW0KykYhR0yXXgM81u5hsXtAUVSh4MMNCwtAYlwbJjybLFMtgC+PV+hY9sjE43 2xcqnCWJBnDM1jaaaGbXpjy++of9ACkX3jqWCO6gfaaIUgGCz4lpMZ9wLYYnkLKbJ9xU xtHjq7lBuDTwZv2gDpIHkYvgJ1mm5t0qH7AYXkdaFE0TALKjOBhzTu1m0lbm/1W7bAps JGYEYkRExW9/Wxd23CJRqw+X/OcWZmMCQjVP70I1mXmOgfZuf53ae3OHt+7w4Cly7ofQ 4O3Q== X-Gm-Message-State: APjAAAX+7R6JffqGXiQcBjxPg2yFrHZtjXTeqc33SJ4mEzOwRxln6Ygu AgQz2PvlvFKya1G6ppXF7Dov6g5vL7DzSQcO X-Received: by 2002:ac2:514b:: with SMTP id q11mr15753843lfd.33.1562096545325; Tue, 02 Jul 2019 12:42:25 -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.24 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 12:42:24 -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 11/32] crypto: arm/aes-neonbs - switch to library version of key expansion routine Date: Tue, 2 Jul 2019 21:41:29 +0200 Message-Id: <20190702194150.10405-12-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 --- arch/arm/crypto/Kconfig | 2 +- arch/arm/crypto/aes-neonbs-glue.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/arch/arm/crypto/Kconfig b/arch/arm/crypto/Kconfig index a95322b59799..b24df84a1d7a 100644 --- a/arch/arm/crypto/Kconfig +++ b/arch/arm/crypto/Kconfig @@ -82,8 +82,8 @@ config CRYPTO_AES_ARM_BS tristate "Bit sliced AES using NEON instructions" depends on KERNEL_MODE_NEON select CRYPTO_BLKCIPHER + select CRYPTO_LIB_AES select CRYPTO_SIMD - select CRYPTO_AES help Use a faster and more secure NEON based implementation of AES in CBC, CTR and XTS modes diff --git a/arch/arm/crypto/aes-neonbs-glue.c b/arch/arm/crypto/aes-neonbs-glue.c index 617c2c99ebfb..f43c9365b6a9 100644 --- a/arch/arm/crypto/aes-neonbs-glue.c +++ b/arch/arm/crypto/aes-neonbs-glue.c @@ -64,7 +64,7 @@ static int aesbs_setkey(struct crypto_skcipher *tfm, const u8 *in_key, struct crypto_aes_ctx rk; int err; - err = crypto_aes_expand_key(&rk, in_key, key_len); + err = aes_expandkey(&rk, in_key, key_len); if (err) return err; @@ -123,7 +123,7 @@ static int aesbs_cbc_setkey(struct crypto_skcipher *tfm, const u8 *in_key, struct crypto_aes_ctx rk; int err; - err = crypto_aes_expand_key(&rk, in_key, key_len); + err = aes_expandkey(&rk, in_key, key_len); if (err) return err;