From patchwork Sun Mar 26 18:49:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 9645171 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9046E60329 for ; Sun, 26 Mar 2017 18:52:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 820FD27F4B for ; Sun, 26 Mar 2017 18:52:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76C6C27F81; Sun, 26 Mar 2017 18:52:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0439227F54 for ; Sun, 26 Mar 2017 18:52:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751716AbdCZSv2 (ORCPT ); Sun, 26 Mar 2017 14:51:28 -0400 Received: from mail-wr0-f169.google.com ([209.85.128.169]:36239 "EHLO mail-wr0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751668AbdCZSvE (ORCPT ); Sun, 26 Mar 2017 14:51:04 -0400 Received: by mail-wr0-f169.google.com with SMTP id w11so15508865wrc.3 for ; Sun, 26 Mar 2017 11:49:34 -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=qhLJn3DJg+8hHIhTR4afmVkmaCukksxN/qb2uk2qrXo=; b=X14uReGet1J3BzZZLMIR2guXQFbelSudROIRPZm0vUBdCLQazb0De97Uk40ktsginS iOtz2DeALogPgXoyVEukelylv7d/B+M16NzUmafYDcvCiUTbyYtpueqi7zsY+ldrByZz NYwzOV89+FVbJJtvwI5BqcU9qYLh8CwrcbDTo= 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=qhLJn3DJg+8hHIhTR4afmVkmaCukksxN/qb2uk2qrXo=; b=uV1r7UwCgQbhWhlvUn4ymgMxmV3/ylL9qfCfpaj0CjQIyoZXTTnL12vjR2fpalE0uk JGnGvEBdlS/tgmHI4lJ5BvIInpcsRa5YsVXth+mI2+fL9PKkLD8A6TK2AiYkncsI8dBH NNqX6gRJ2ti/NvlwpchIHIaF9VBvmPD2sV4BaZfY64pj7zlVk2Lq+31bke5tnC5fUfaa TDt4dbRiMMM4uEcaM65OyxUoTZyxg6+sZV0Q0lqNshXGrZZ2+wu0RhW6OFhQq/qainSs zv41EdadzkQgBHFAiebVR57TI+/3p5CoPZ5vCMI2unMwsM0Bh4RToPK54X39WGNXtYPC POUg== X-Gm-Message-State: AFeK/H1Yeidsiw/Iby7MVQTySeZ2lfPTbF7Mot8QW+GUa0/GxSK7B5i7T69NwZHHIn3YGsFJ X-Received: by 10.28.20.70 with SMTP id 67mr6661900wmu.86.1490554173158; Sun, 26 Mar 2017 11:49:33 -0700 (PDT) Received: from localhost.localdomain ([196.81.160.3]) by smtp.gmail.com with ESMTPSA id i133sm11362112wmg.26.2017.03.26.11.49.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 26 Mar 2017 11:49:32 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au Cc: nico@linaro.org, ebiggers3@gmail.com, Ard Biesheuvel Subject: [PATCH 7/7] crypto: aes - allow alternative AES drivers to fulfil AES dependency Date: Sun, 26 Mar 2017 19:49:08 +0100 Message-Id: <1490554148-10953-8-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490554148-10953-1-git-send-email-ard.biesheuvel@linaro.org> References: <1490554148-10953-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Allow other AES drivers than crypto/aes_generic.o to fulfil soft dependencies on AES. This allows CRYPTO_AES to be disabled if no hard dependencies on it are enabled. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig | 1 + arch/arm64/crypto/Kconfig | 1 + crypto/Kconfig | 9 ++++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/arm/crypto/Kconfig b/arch/arm/crypto/Kconfig index 10c9d0c7e615..91b282cf7a99 100644 --- a/arch/arm/crypto/Kconfig +++ b/arch/arm/crypto/Kconfig @@ -65,6 +65,7 @@ config CRYPTO_AES_ARM tristate "Scalar AES cipher for ARM" select CRYPTO_ALGAPI select CRYPTO_AES_CORE + select CRYPTO_HAVE_AES help Use optimized AES assembler routines for ARM platforms. diff --git a/arch/arm64/crypto/Kconfig b/arch/arm64/crypto/Kconfig index c5b04627a721..e1fbf8b78d7c 100644 --- a/arch/arm64/crypto/Kconfig +++ b/arch/arm64/crypto/Kconfig @@ -44,6 +44,7 @@ config CRYPTO_CRC32_ARM64_CE config CRYPTO_AES_ARM64 tristate "AES core cipher using scalar instructions" select CRYPTO_AES_CORE + select CRYPTO_HAVE_AES config CRYPTO_AES_ARM64_CE tristate "AES core cipher using ARMv8 Crypto Extensions" diff --git a/crypto/Kconfig b/crypto/Kconfig index 1ba4e836077b..3a16e58992bc 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -896,7 +896,11 @@ comment "Ciphers" config CRYPTO_NEED_AES tristate - select CRYPTO_AES + select CRYPTO_AES if (CRYPTO_NEED_AES=y && CRYPTO_HAVE_AES != y) || \ + (CRYPTO_NEED_AES=m && !CRYPTO_HAVE_AES) + +config CRYPTO_HAVE_AES + tristate config CRYPTO_AES tristate "AES cipher algorithms" @@ -927,6 +931,7 @@ config CRYPTO_AES_CORE config CRYPTO_AES_TI tristate "Fixed time AES cipher" select CRYPTO_ALGAPI + select CRYPTO_HAVE_AES help This is a generic implementation of AES that attempts to eliminate data dependent latencies as much as possible without affecting @@ -946,6 +951,7 @@ config CRYPTO_AES_586 depends on (X86 || UML_X86) && !64BIT select CRYPTO_ALGAPI select CRYPTO_AES_CORE + select CRYPTO_HAVE_AES help AES cipher algorithms (FIPS-197). AES uses the Rijndael algorithm. @@ -968,6 +974,7 @@ config CRYPTO_AES_X86_64 depends on (X86 || UML_X86) && 64BIT select CRYPTO_ALGAPI select CRYPTO_AES_CORE + select CRYPTO_HAVE_AES help AES cipher algorithms (FIPS-197). AES uses the Rijndael algorithm.