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: 96016 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp922346qgd; Sun, 26 Mar 2017 11:53:15 -0700 (PDT) X-Received: by 10.98.158.71 with SMTP id s68mr20940346pfd.159.1490554394939; Sun, 26 Mar 2017 11:53:14 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z77si7165887pfk.411.2017.03.26.11.53.14; Sun, 26 Mar 2017 11:53:14 -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; 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 S1751716AbdCZSv2 (ORCPT + 1 other); 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 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(-) -- 2.7.4 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.