From patchwork Tue Jul 2 19:41:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 168353 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4653383ilk; Tue, 2 Jul 2019 12:42:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3NG7fabcwZlI8cTkfEoh8LkdGJq6dfXEBm+Aj+kA9yeYA6fLnxkT9ylcHXZ4vg5yTpqkL X-Received: by 2002:a17:90a:ba93:: with SMTP id t19mr7426191pjr.139.1562096544765; Tue, 02 Jul 2019 12:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562096544; cv=none; d=google.com; s=arc-20160816; b=bj0F9Xj/Adsiqm5t8cPbQHZT+8Q+5Ievxu8ZyfLTED4qg+YJ3V8YuSacFkR5RLkvHW jALzf0l858HJg4c/j5WvjODMdK5FvCnNnYr2pcJSFf+e7ykWGxnfylXd0uQOAeDI0cVc O37Gz7rPqM39H4LE1Om2gXno7YA11sNZsac9FWLdG2QlhiDfeDeqFJZWcfRLoUFogQHQ r5HZU0azmK4SedvXdAzVbnwHxcZQ0wllqUKQ1GUm9hS+6nSfLH9wutTHZlTEM+T3JaDI B9kufFEE8TZ/pNuN/N8ZvOFz9E2kQuOG3GSO/OjGQT6bZ3O1uSJYF1NUo8erNj84THNO UCPw== 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=2vu90pozuzPI+4NwppRxnbZtYKOaoe2IbHpzwdsfy4U=; b=RAXAdwmJc1WUnoJeamFqwBgFAHRefQe/WPdBhfwXT4dNAWz7Ls8YGzLo4Fosj4IRIn CAMpdVDFrJIhId56aEZlnkawcn9Y0mOTYeQD8aTS5YW9eWOxn2aV0nlvricN6VzBwL5t 4S5rT3xJZq6AvxvYQ0q+AAc7PLcnhvkZu+R+ZNn1UucdLTdPUJHPtYRUJ2yXWIg57vTX IsugdpFUwkp/t4Z1F5bRUuauJh62uQDm4ZzOLRx6Oa/8K+RQZetAagsmr37l+k64K2xV qYedMVaR01/qmHOyQwQM7H4fz9VLe2LH07koOda22pr1T0eFlIy6DFLfbByirEZXjUuT rvtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="bgemgjj/"; 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.24; Tue, 02 Jul 2019 12:42:24 -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="bgemgjj/"; 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 S1727051AbfGBTmY (ORCPT + 3 others); Tue, 2 Jul 2019 15:42:24 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:36632 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727049AbfGBTmX (ORCPT ); Tue, 2 Jul 2019 15:42:23 -0400 Received: by mail-lj1-f196.google.com with SMTP id i21so18199590ljj.3 for ; Tue, 02 Jul 2019 12:42:22 -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=2vu90pozuzPI+4NwppRxnbZtYKOaoe2IbHpzwdsfy4U=; b=bgemgjj/Z8o864DCjP3XY81G24w7BW3XOxgNRvKtwcYqQd7DeqA2OMuDc3wF+cKdTE JXIfYaSod1nr8sPXEwlPeNlScTEZY4zke+aPMAvfbv3sUHr6C1L5IAfnfNN2bRljgMcy 7/U03X/wtFjl4cYcvZKe+zM0yF3Fblk+4HW5O95SIHyLtEGhySx9p3LZbGtFzRobdo1K UCM+jiy75eUH2HD24zs3Ke/l5xa3O2CzvLVZS5RVRfiLI7s6JZQdHpyDpuKXUTqopjPt l00bKwcOd8eWaJq98njJ/tvGRt8fvh90uS09AKKo8xKovvwZEAD4biWmoTkC1+EyXc02 JWLA== 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=2vu90pozuzPI+4NwppRxnbZtYKOaoe2IbHpzwdsfy4U=; b=kLyz6Ov6/4bt9bztxBmm9LJ3C2ej0IWSiMApbXZX3pqRjjMmbfDkbSRzZxf7RN6jGX kOkz9XK9Tedy8ZbL0OW+IizmGZMdE6nnIz1jL1nLCnY5A2S6FJidfLD60Nerh9J4MXSI E3ukDWhsbAvaSYuHiBhEGrQuvkwODVVIAWbIB3VBs/kEErRBflbqwrTctpoxPftpZI/W AoxklhE9xKnGviUnf7t8C+V+pAxl06W2eb1idkNgpKbftJ5KKVbOeOrb+3kyO33/94aV DIA7d/eLiNvgLpd8wmkAqCcAGpgVxBoEsvYpiUOBkcLhyL1dBHJT9wyPKUruiAQbeblY FmiQ== X-Gm-Message-State: APjAAAXkWkco6mdsWiViLaTVXOCZ4PSMpeg23qtBhj/h+jYEXcWDMm/m 9jOpVn/JwRLaZG34IKWqwmMwpBoZRWlvRQdU X-Received: by 2002:a2e:50e:: with SMTP id 14mr18798392ljf.5.1562096541399; Tue, 02 Jul 2019 12:42:21 -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.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 12:42:20 -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 08/32] crypto: cesa/aes - switch to library version of key expansion routine Date: Tue, 2 Jul 2019 21:41:26 +0200 Message-Id: <20190702194150.10405-9-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/marvell/cipher.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 3fca5f7e38f0..fdccadc94819 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -213,7 +213,7 @@ config CRYPTO_CRC32_S390 config CRYPTO_DEV_MARVELL_CESA tristate "Marvell's Cryptographic Engine driver" depends on PLAT_ORION || ARCH_MVEBU - select CRYPTO_AES + select CRYPTO_LIB_AES select CRYPTO_DES select CRYPTO_BLKCIPHER select CRYPTO_HASH diff --git a/drivers/crypto/marvell/cipher.c b/drivers/crypto/marvell/cipher.c index 2fd936b19c6d..debe7d9f00ae 100644 --- a/drivers/crypto/marvell/cipher.c +++ b/drivers/crypto/marvell/cipher.c @@ -257,7 +257,7 @@ static int mv_cesa_aes_setkey(struct crypto_skcipher *cipher, const u8 *key, int ret; int i; - ret = crypto_aes_expand_key(&ctx->aes, key, len); + ret = aes_expandkey(&ctx->aes, key, len); if (ret) { crypto_skcipher_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN); return ret;