From patchwork Wed Jun 12 12:48: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: 166566 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3640758ilk; Wed, 12 Jun 2019 05:49:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyB25aAzUNahKePMfAhjFcI2iy8VwE/BZGtORVh+FDAJ9EA4rRO8qYvxFoZEFNcK0P66eol X-Received: by 2002:a63:5d45:: with SMTP id o5mr25390209pgm.40.1560343740503; Wed, 12 Jun 2019 05:49:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560343740; cv=none; d=google.com; s=arc-20160816; b=STL5G+jG0z3lZJ5T4mCSHyR+vwY6Rxf6KWR3EqH8w56Ls4v64IyUBiErGs9nONwuhb uHHgvWJdMERwR7iwLgEv9rxNlfQ4pTmOE37oP7Aghb93pimWZtvx9k7eJbZPZ50pGTvL rzFtqSY2gP0CFAluXtOzWIr/2Ut9737sPdMP7CI2KNmd04cO+PoPVvgHZx/3b4/LTW12 1SKMcKPOP2cfaR+ODosj4KadNSwlLJznIoKwe74Big78X4v56X883WmrYPozfRvsil3R ZJhxg7TjLIFYNCGkC1DorUg4YlmQRgPx5Eeotto5iZ0zMzulhJK0Cev+luS0vKR8FwUG bIUA== 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=Rp2SyHztXuSc5EPDjn72803h6AQOk7vXYYLU7TdxcTM=; b=NFijlbR2YJzQQZKxP0CYbbOlVa18ndR2iAIdjeS1BacCZCQwGaz9gIhhUYGgcvl+0r Juj+Xz2xCF02oEYZztJWbRIQVrIJtg5WrKUD3vHNUkJXlAiXM5eNWWEFMcB0RQgZW8wX 8gprmMu/uzuhUuxVJgzDhOEhRWpRN/yFPFAdzNOB7fIFRBMi7mltuIhT4URYNo+Hk9lm wfbjWCROu6ijg35/jYYBDwwA5gZTv3v5pSfJeYnuUoIasHLlOV26omnTmSSOgY++bKlr QJbhzo1smDFjlP3T9pEIGp1Z1DXzOezhNUrrGBX7WA/cmyepPo8hRs6/DwE05/3mLj80 G+Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i589ezzq; 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 b14si16011497pgk.423.2019.06.12.05.49.00; Wed, 12 Jun 2019 05:49: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=i589ezzq; 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 S2406812AbfFLMs7 (ORCPT + 3 others); Wed, 12 Jun 2019 08:48:59 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43857 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439221AbfFLMs7 (ORCPT ); Wed, 12 Jun 2019 08:48:59 -0400 Received: by mail-wr1-f66.google.com with SMTP id p13so6668261wru.10 for ; Wed, 12 Jun 2019 05:48:57 -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=Rp2SyHztXuSc5EPDjn72803h6AQOk7vXYYLU7TdxcTM=; b=i589ezzqAAjlFViP74UzWJqZJFiqtT1FTmC1a0q0ImhT7u9tc+tCz60xh9CJLqUg8c UNA2tMsx9Yh1HnZlM21Aw5fUZlhYeViGelWAyjbm6p++n52DTRJpXRcZzw65FVgIjJqV OjBCZYAp5n3o3nQr3y/iU0RTpzpqIXaiPOVeiHghbqoDr2wiSK57WSDk3WeZfHGfj/bK zsIRzC2I36pon57I3tT8KN3q2OnloiQuNjPfEnMDRpSJENgsjy6djRQjffwk+WgctCp/ lvuNIGWEjds6ZOpJKkedu/x9IYDIUhgSive3a62OmT6cPwWsNTLTnuRC7p7oViSpyU71 Vewg== 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=Rp2SyHztXuSc5EPDjn72803h6AQOk7vXYYLU7TdxcTM=; b=DrqPr7GtZlf+G7L/zd8Qj4Um8v0vPG/rb7soZ/0IDYIdaab7ZqmUz+wbls8uN8u6f/ KRSgKwu6Bus16q+kUn2IkrVRsm3YL75ErN3cEcPxaPXh2RKNOduwjxkt/6/dOmJ4jLny c/RxIsegu3nP7TsQDWFdbV1zNRN5OJew/rdfxlmLLV/maByFVzPcmbtGCT4gB9dmsvmv pBGQrcQGeSd5O0km36rgGtOb47lB38Id14ifPNagwc9eTIILTqyhrTfqoi8UIE/XXwOZ nT/ELBrnR7fMt+YQOnDZoMJkYe894RzMGSx5jizko7hmiI4XdslBMA7Z01qjzs8JomwA 5p9A== X-Gm-Message-State: APjAAAWMZfLUvRRucTWPSvjzPLNsb9IJKT/4/VJ+LhPnKfd2Z1SDNLdB 1ui5/Dd+HVXjPMABkRwyffB3HtCe7jNYkA== X-Received: by 2002:adf:db81:: with SMTP id u1mr53014316wri.296.1560343736822; Wed, 12 Jun 2019 05:48:56 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:353a:f33a:a393:3ada]) by smtp.gmail.com with ESMTPSA id s8sm28505480wra.55.2019.06.12.05.48.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jun 2019 05:48:56 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, ebiggers@kernel.org, Ard Biesheuvel Subject: [RFC PATCH 09/20] crypto: safexcel/aes - switch to library version of key expansion routine Date: Wed, 12 Jun 2019 14:48:27 +0200 Message-Id: <20190612124838.2492-10-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190612124838.2492-1-ard.biesheuvel@linaro.org> References: <20190612124838.2492-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 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.20.1 diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 539592e1d6f1..a6067bb5a6a2 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -701,7 +701,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 de4be10b172f..483632546260 100644 --- a/drivers/crypto/inside-secure/safexcel_cipher.c +++ b/drivers/crypto/inside-secure/safexcel_cipher.c @@ -158,7 +158,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;