From patchwork Tue Jun 20 09:28:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 105938 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1274246qgd; Tue, 20 Jun 2017 02:36:11 -0700 (PDT) X-Received: by 10.98.16.72 with SMTP id y69mr29617423pfi.30.1497951371395; Tue, 20 Jun 2017 02:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951371; cv=none; d=google.com; s=arc-20160816; b=SMtg4z8R8V1eM5VJq+7tQ3HfDlHmR7U8YCLlm8gr3wJ2d+NS5k3La/fT/awfPcTAYm ORFxfD2DF3RbTSxYi5fFJsqZMqrHodOOpbbbQkgZNfqJucIGsGyJnT6C9xXrQd+SBh9B ynUufic1E7M+7ob0PqrLooANygaJh1BnUSfLh08sE1w/8Dibdimy4TsKUbk+BkwxNAYI 5d4KdKJqoU/+lhNkNB2A4KxtNIVvoMAB6/AVL7kVIPT5EtgmmVyV62FW+jeCB3Olzxv7 HWZbKBbetXOB1OJvx3CDTlrJLiG+ZWdKEBC6yos5ODQc0k6pmEEqXkL2YPRwtU2fs4BR HeVQ== 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=Uh8oDe2O9QUwg1musPxNqZNFSQ22hrtZn8H7YLYLaTc=; b=vmlFJoqQ0qdNPTKNElBV7Jhd0FvBZ7Gmx/f7k99D4Lld8rXAl4h1l6azJoVEaNxOCT fo+DT8ztLvJmJ36tkTYjQQNMODH9cXLisbTg0+Ck80DsQ4BJ7PWQAAHReCyDMSPcutNb 6HLD8VJoPLzUACsEM9zw2HtpX2M3kvrRxY0gRBXv6c1wLDm4xSrO/268sIhf18qtlp0J d4zLFWTquVxMJle7vnT94Pc4OT6FytJqzBc7J0oBStjxtDtVunEz0Q0Euze4MxbKMr2C p2yamAhSsNcPuLEWKyGHK7FGGJ2rGVtsgmcwC7Olpy1tYXvQFzU2cqkWgMqHOWNR7cGM 4LfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=cYOLcP2Q; 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 p1si10461961pge.322.2017.06.20.02.36.11; Tue, 20 Jun 2017 02:36:11 -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=cYOLcP2Q; 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 S1751046AbdFTJam (ORCPT + 1 other); Tue, 20 Jun 2017 05:30:42 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:38772 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752022AbdFTJ3L (ORCPT ); Tue, 20 Jun 2017 05:29:11 -0400 Received: by mail-wm0-f53.google.com with SMTP id u195so14358653wmd.1 for ; Tue, 20 Jun 2017 02:29:10 -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=Uh8oDe2O9QUwg1musPxNqZNFSQ22hrtZn8H7YLYLaTc=; b=cYOLcP2QTdMGxcWye+5dkYJDb9e/wCqkP3o1IH+wWv5Ngv8AhfilfXbfBIXPEjS2Vx nmESiy5nFgKi5BowSFIa+pHsBfzStQsGZliT28u3E2gSw2uqOHgsh5aPPIfMUzWw3Xan DjonRo5e59yplxynLrPGsU+McDBLGHKBBX/0c= 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=Uh8oDe2O9QUwg1musPxNqZNFSQ22hrtZn8H7YLYLaTc=; b=suZLUWU1RRwIqwoxuNftQNQFw+sRdKyWPtasJNFXu0a9EZUr3v74SdKMx8K9qgS0s1 S1H3arsuNalfiWc2iw89U/MxqBvT1UL4lR76YFLWPOr3BUiRAZN5U7UvpV29MZYtJuL6 1qpy7FCdKEoSt5aWS5XJau3VRpjP12wZUgvWF3MuKY3eXVvLYtnvFQ6PGtPsu5n9/Mn6 lxsi6NS9zd5pyRGi80p2rlsK8MHzPz7kDG/Kuf4uK2KXMqlUvwuFQzI961It0l+gmY3w lC3orb2HX0QRhxgF8AcmpVgZoUlULo846A2Fu8MZmayacxHSp7X6aSjD6+FBtqmLXZwl fR0g== X-Gm-Message-State: AKS2vOwaDlBvREgLIGF/jr1elOrjt90v95+0eRP56umsmLRkz/4WRPyi XIyk3FbbgkXUL5cLvK1jgw== X-Received: by 10.80.175.34 with SMTP id g31mr20434842edd.24.1497950949613; Tue, 20 Jun 2017 02:29:09 -0700 (PDT) Received: from localhost.localdomain (101-126-045-062.dynamic.caiway.nl. [62.45.126.101]) by smtp.gmail.com with ESMTPSA id a52sm6033452eda.44.2017.06.20.02.29.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:29:08 -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 v3 5/7] crypto: aes - repurpose CRYPTO_AES and introduce CRYPTO_AES_GENERIC Date: Tue, 20 Jun 2017 11:28:58 +0200 Message-Id: <1497950940-24243-6-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497950940-24243-1-git-send-email-ard.biesheuvel@linaro.org> References: <1497950940-24243-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 generic "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