From patchwork Fri Jun 16 11:17:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 105709 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp1249354qgd; Fri, 16 Jun 2017 04:18:09 -0700 (PDT) X-Received: by 10.98.14.79 with SMTP id w76mr10287691pfi.63.1497611889518; Fri, 16 Jun 2017 04:18:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497611889; cv=none; d=google.com; s=arc-20160816; b=Zi9t5e6BYzxmmLeOhHRn2EIXBVcoprkaw8JEwD3akDP3dMOSAkkSneXk1/oTMDU4NI IU1eTkcf5CmEAsv2IQRtmvNj1ZfC693pWUhg1mw97/dbn02IjvPS9R1PQJvjtg2jz1jJ dIHIn9xndzpNQtkhiJXZoYdPvTpZOR+SzDpkGY/D0GnduyoxdM3b+oDCxIMBDeVsEHHW SphZ6MKPjEX7zpUzdCZci48gtUmyd/JO9/x9BMMKn6MSZCn03bvTT2/GiHm/5nUVNl34 y/ym2bl06lImqQu4y920Ep39Wo5Y2hgImp8njsuEaC4hJhUVrUWEUZH3n7e/Tg9MDkft PRCw== 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:arc-authentication-results; bh=sAlE3NdGEKlZZPIfwtvSFljrkamEKv1orX2ks+z8bbg=; b=iWRCVtlkCTtEFMWQy0zC22PrMGD0qqQVnJQHA9JWn9VW+BqFRFcsr7CKOjvcDEylV4 hQxH+Ev4zJBxeUh2cXhdjm/QD+4doCFYuW5HR7ZXkmBJ+c/3LRdzyq5p5XM7Q06yj61V HYFOyDTwqxdRvpNLpdwsnQsATP7crYYKLr0y89NuuBSH1sciaEyql/JY4w641PKM1iGb Saa8MaN70jt0RwuuVZjlAa3jtpbUeguBVFC1UF2Vka0c5YnUENguwwLElXt3NfvZlmcd NdXSMOBOmqXNU8iaPpGrldTyv0paP9N1ik3DWxQF7fNU1usAT/w5G8YNvMTr82Y+T3lX kZkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=L8Wpr3Hm; 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 a7si1740382pgn.206.2017.06.16.04.18.09; Fri, 16 Jun 2017 04:18:09 -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.b=L8Wpr3Hm; 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 S1752671AbdFPLSH (ORCPT + 1 other); Fri, 16 Jun 2017 07:18:07 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:36352 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752636AbdFPLSF (ORCPT ); Fri, 16 Jun 2017 07:18:05 -0400 Received: by mail-wm0-f54.google.com with SMTP id m125so23233084wmm.1 for ; Fri, 16 Jun 2017 04:18:04 -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=sAlE3NdGEKlZZPIfwtvSFljrkamEKv1orX2ks+z8bbg=; b=L8Wpr3Hm8BlNqLW3BSYzuO3msL9FWpoV/7KezJISNQ6pXT3qUJEzv6/AZNgykgNkvR pykj8b/Lxxi6hiR+wEeXoziT/19NuTdthA7/wr+SmGYWxdWMgBLnGLb4dsMSdooTeiuU eVogQSiWmBqY2mUtmDoQmAoy99DlqpnK/0iRw= 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=sAlE3NdGEKlZZPIfwtvSFljrkamEKv1orX2ks+z8bbg=; b=lypAHNIXhesFYR7CV+B7yEhVJzmokpqM5UpFEFXBzNojBZhXT/jpXKG0p6tLTeYKyz 2LgUrEWY2jJS/VX0HZubmFFTzLHM4HmBNX5fBCfHDrdHRiR95nGcKXLH/rZn9Xh71Q7b XWD7obqHl8neLeqeNMVdwFzMrQQQt2Rm1Y0kEaK1lDV+VjrXhYAOvs0cE8uzaiPpVoBD Kg0+fSvgF9IJEMSXUwcc3tDlw6z2AGA+eAPojaUn2sZxL0l8k4SdHmG7BuBBBkMjFqAF akOxNwQjP96IGUGPMXfqejEoT4U668eeI35ECRe7cQOJE1dSwSbgzYYo6NuWxWYRU9p/ Urxg== X-Gm-Message-State: AKS2vOx0+7cv/r1CcPcqD93fN3bUNuIz9AixDb27viWwnLsUuNjod+LR Pq1pzKRh4+CPyIvajPiieg== X-Received: by 10.80.167.65 with SMTP id h59mr7144998edc.0.1497611883335; Fri, 16 Jun 2017 04:18:03 -0700 (PDT) Received: from ards-macbook-pro.arnhem.chello.nl (dhcp-077-251-017-237.chello.nl. [77.251.17.237]) by smtp.gmail.com with ESMTPSA id k17sm984880edb.37.2017.06.16.04.18.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Jun 2017 04:18:02 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, nico@linaro.org, ebiggers3@gmail.com, Ard Biesheuvel Subject: [PATCH v2 4/6] crypto: aes - repurpose CRYPTO_AES and introduce CRYPTO_AES_GENERIC Date: Fri, 16 Jun 2017 13:17:47 +0200 Message-Id: <1497611869-6126-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497611869-6126-1-git-send-email-ard.biesheuvel@linaro.org> References: <1497611869-6126-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 Repurpose the Kconfig symbol CRYPTO_AES to signify that a 'select' or 'depends on' relationship on it can be satisfied by any driver that exposes a "aes" cipher. The existing generic AES code is now controlled by a new Kconfig symbol CRYPTO_AES_GENERIC, and only dependencies on CRYPTO_AES that truly depend on its exported lookup tables are updated accordingly. Signed-off-by: Ard Biesheuvel --- arch/arm/crypto/Kconfig | 2 +- arch/arm64/crypto/Kconfig | 2 +- crypto/Kconfig | 8 ++++++-- crypto/Makefile | 2 +- net/sunrpc/Kconfig | 3 ++- 5 files changed, 11 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/arch/arm/crypto/Kconfig b/arch/arm/crypto/Kconfig index fd77aebcb7a9..3a6994ada2d1 100644 --- a/arch/arm/crypto/Kconfig +++ b/arch/arm/crypto/Kconfig @@ -64,7 +64,7 @@ config CRYPTO_SHA512_ARM config CRYPTO_AES_ARM tristate "Scalar AES cipher for ARM" select CRYPTO_ALGAPI - select CRYPTO_AES + select CRYPTO_AES_GENERIC help Use optimized AES assembler routines for ARM platforms. diff --git a/arch/arm64/crypto/Kconfig b/arch/arm64/crypto/Kconfig index db55e069c17b..7ffe88267943 100644 --- a/arch/arm64/crypto/Kconfig +++ b/arch/arm64/crypto/Kconfig @@ -43,7 +43,7 @@ config CRYPTO_CRC32_ARM64_CE config CRYPTO_AES_ARM64 tristate "AES core cipher using scalar instructions" - select CRYPTO_AES + select CRYPTO_AES_GENERIC config CRYPTO_AES_ARM64_CE tristate "AES core cipher using ARMv8 Crypto Extensions" diff --git a/crypto/Kconfig b/crypto/Kconfig index 1e6e021fda10..9ae3dade4b2b 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -898,6 +898,10 @@ config CRYPTO_AES_CORE tristate config CRYPTO_AES + tristate + select CRYPTO_AES_GENERIC + +config CRYPTO_AES_GENERIC tristate "AES cipher algorithms" select CRYPTO_ALGAPI select CRYPTO_AES_CORE @@ -940,7 +944,7 @@ config CRYPTO_AES_586 tristate "AES cipher algorithms (i586)" depends on (X86 || UML_X86) && !64BIT select CRYPTO_ALGAPI - select CRYPTO_AES + select CRYPTO_AES_GENERIC help AES cipher algorithms (FIPS-197). AES uses the Rijndael algorithm. @@ -962,7 +966,7 @@ config CRYPTO_AES_X86_64 tristate "AES cipher algorithms (x86_64)" depends on (X86 || UML_X86) && 64BIT select CRYPTO_ALGAPI - select CRYPTO_AES + select CRYPTO_AES_GENERIC help AES cipher algorithms (FIPS-197). AES uses the Rijndael algorithm. diff --git a/crypto/Makefile b/crypto/Makefile index 0979ca461ddb..73395307bcea 100644 --- a/crypto/Makefile +++ b/crypto/Makefile @@ -97,7 +97,7 @@ obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o CFLAGS_serpent_generic.o := $(call cc-option,-fsched-pressure) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149 obj-$(CONFIG_CRYPTO_AES_CORE) += aes_core.o -obj-$(CONFIG_CRYPTO_AES) += aes_generic.o +obj-$(CONFIG_CRYPTO_AES_GENERIC) += aes_generic.o obj-$(CONFIG_CRYPTO_AES_TI) += aes_ti.o obj-$(CONFIG_CRYPTO_CAMELLIA) += camellia_generic.o obj-$(CONFIG_CRYPTO_CAST_COMMON) += cast_common.o diff --git a/net/sunrpc/Kconfig b/net/sunrpc/Kconfig index ac09ca803296..58aa2ada40b3 100644 --- a/net/sunrpc/Kconfig +++ b/net/sunrpc/Kconfig @@ -19,7 +19,8 @@ config RPCSEC_GSS_KRB5 tristate "Secure RPC: Kerberos V mechanism" depends on SUNRPC && CRYPTO depends on CRYPTO_MD5 && CRYPTO_DES && CRYPTO_CBC && CRYPTO_CTS - depends on CRYPTO_ECB && CRYPTO_HMAC && CRYPTO_SHA1 && CRYPTO_AES + depends on CRYPTO_ECB && CRYPTO_HMAC && CRYPTO_SHA1 + select CRYPTO_AES depends on CRYPTO_ARC4 default y select SUNRPC_GSS