From nobody Wed Apr 15 05:38:01 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE4A1C43334 for ; Mon, 25 Jul 2022 18:37:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232727AbiGYShA (ORCPT ); Mon, 25 Jul 2022 14:37:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236084AbiGYSgx (ORCPT ); Mon, 25 Jul 2022 14:36:53 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80CCF1275A; Mon, 25 Jul 2022 11:36:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id D2785CE13B5; Mon, 25 Jul 2022 18:36:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05C24C341C8; Mon, 25 Jul 2022 18:36:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658774209; bh=woYVIEWGYvf6j+v2IaoCj1jL+lqsBN5fv0iS4lSB0KU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=khGlJfutfJp8pfvEYcDLhlTXTvS5KYRX4sfXCDd2llmGB+Wv1fjUicwQPWac2Je5l nN3gOQ2pU8h3pPOw2lgwf1PdGWQgS6R5ngkrF5C6/vlXH2CFP1SzFNdIc62NDnNolc rRjmJvK0FbA/1OJpbjVTG4LAQGAlXVfuvmr46l6wzlNqUwBkp5X9RTHKJRNMix4EU7 AMHHn7t3iwF/jTlfl8iRQtK80/npJmGU3Yk/lz4ysKJxgriWZY3znI7Bv4YP7/64il wMfUG8TIAGl09HWxG9RPIxt9z4+y0STSvmvSE90CpeWoeX8JufVm9e8rc1B09LI7CQ 9Vjwr8YsuJfVg== From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Jason A . Donenfeld " Subject: [PATCH v3 1/3] crypto: lib - create utils module and move __crypto_memneq into it Date: Mon, 25 Jul 2022 11:36:34 -0700 Message-Id: <20220725183636.97326-2-ebiggers@kernel.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220725183636.97326-1-ebiggers@kernel.org> References: <20220725183636.97326-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Eric Biggers As requested at https://lore.kernel.org/r/YtEgzHuuMts0YBCz@gondor.apana.org.au, move __crypto_memneq into lib/crypto/ and put it under a new tristate. The tristate is CRYPTO_LIB_UTILS, and it builds a module libcryptoutils. As more crypto library utilities are being added, this creates a single place for them to go without cluttering up the main lib directory. The module's main file will be lib/crypto/utils.c. However, leave memneq.c as its own file because of its nonstandard license. Signed-off-by: Eric Biggers Reviewed-by: Jason A. Donenfeld --- crypto/Kconfig | 2 +- lib/Kconfig | 3 --- lib/Makefile | 1 - lib/crypto/Kconfig | 5 ++++- lib/crypto/Makefile | 3 +++ lib/{ =3D> crypto}/memneq.c | 5 ++++- 6 files changed, 12 insertions(+), 7 deletions(-) rename lib/{ =3D> crypto}/memneq.c (99%) diff --git a/crypto/Kconfig b/crypto/Kconfig index e72bf3fc298cc5..7a10441998209d 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -15,7 +15,7 @@ source "crypto/async_tx/Kconfig" # menuconfig CRYPTO tristate "Cryptographic API" - select LIB_MEMNEQ + select CRYPTO_LIB_UTILS help This option provides the core Cryptographic API. =20 diff --git a/lib/Kconfig b/lib/Kconfig index eaaad4d85bf24b..6a843639814fbf 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -120,9 +120,6 @@ config INDIRECT_IOMEM_FALLBACK =20 source "lib/crypto/Kconfig" =20 -config LIB_MEMNEQ - bool - config CRC_CCITT tristate "CRC-CCITT functions" help diff --git a/lib/Makefile b/lib/Makefile index 67482f5ec0e899..0557be76c2565f 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -251,7 +251,6 @@ obj-$(CONFIG_DIMLIB) +=3D dim/ obj-$(CONFIG_SIGNATURE) +=3D digsig.o =20 lib-$(CONFIG_CLZ_TAB) +=3D clz_tab.o -lib-$(CONFIG_LIB_MEMNEQ) +=3D memneq.o =20 obj-$(CONFIG_GENERIC_STRNCPY_FROM_USER) +=3D strncpy_from_user.o obj-$(CONFIG_GENERIC_STRNLEN_USER) +=3D strnlen_user.o diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig index 9ff549f63540fa..b09d9d6546cbc3 100644 --- a/lib/crypto/Kconfig +++ b/lib/crypto/Kconfig @@ -2,6 +2,9 @@ =20 menu "Crypto library routines" =20 +config CRYPTO_LIB_UTILS + tristate + config CRYPTO_LIB_AES tristate =20 @@ -71,7 +74,7 @@ config CRYPTO_LIB_CURVE25519 tristate "Curve25519 scalar multiplication library" depends on CRYPTO_ARCH_HAVE_LIB_CURVE25519 || !CRYPTO_ARCH_HAVE_LIB_CURVE= 25519 select CRYPTO_LIB_CURVE25519_GENERIC if CRYPTO_ARCH_HAVE_LIB_CURVE25519= =3Dn - select LIB_MEMNEQ + select CRYPTO_LIB_UTILS help Enable the Curve25519 library interface. This interface may be fulfilled by either the generic implementation or an arch-specific diff --git a/lib/crypto/Makefile b/lib/crypto/Makefile index 919cbb2c220d61..b956b3bae26aaf 100644 --- a/lib/crypto/Makefile +++ b/lib/crypto/Makefile @@ -1,5 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 =20 +obj-$(CONFIG_CRYPTO_LIB_UTILS) +=3D libcryptoutils.o +libcryptoutils-y :=3D memneq.o + # chacha is used by the /dev/random driver which is always builtin obj-y +=3D chacha.o obj-$(CONFIG_CRYPTO_LIB_CHACHA_GENERIC) +=3D libchacha.o diff --git a/lib/memneq.c b/lib/crypto/memneq.c similarity index 99% rename from lib/memneq.c rename to lib/crypto/memneq.c index fb11608b1ec1dd..f2098318428478 100644 --- a/lib/memneq.c +++ b/lib/crypto/memneq.c @@ -59,8 +59,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ =20 -#include #include +#include +#include =20 #ifndef __HAVE_ARCH_CRYPTO_MEMNEQ =20 @@ -174,3 +175,5 @@ noinline unsigned long __crypto_memneq(const void *a, c= onst void *b, EXPORT_SYMBOL(__crypto_memneq); =20 #endif /* __HAVE_ARCH_CRYPTO_MEMNEQ */ + +MODULE_LICENSE("GPL"); --=20 2.37.0 From nobody Wed Apr 15 05:38:01 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADC3FC433EF for ; Mon, 25 Jul 2022 18:36:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236299AbiGYSg6 (ORCPT ); Mon, 25 Jul 2022 14:36:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236046AbiGYSgv (ORCPT ); Mon, 25 Jul 2022 14:36:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DAD21275A; Mon, 25 Jul 2022 11:36:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F0A2760B08; Mon, 25 Jul 2022 18:36:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45EB9C341CE; Mon, 25 Jul 2022 18:36:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658774209; bh=vkNtJ9/f5xSG40imfAVI2qOG8SRV9Ew5rhyxBAoAsOw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D7hDmww8N/IjdWvLVkLO8O5C0dRL0SfI4gFoE0pB+EqeDrRQ4I3BPrJt3wT4egkQ/ 39qoS3FBSffFeapYcLY0CZQHWDYR3t27oq36daKKqZpRfBN3G61ht07ZezPMFMdt91 +mTYz+BoutSirOhNgtCsukBrvarQdIeBLdr0smkFtcakG95ShBqvKD5x8bIYRF08p0 i2ux9gLkwt5E7gvbAYkJKiDgk5pL9CvVj21IO+RnGO+1oIhKDumnviBuQwGQ3dQ6gG 1qsTK6IKcQtl34QdxrKjJFUd3SEiKlaT7GxwebiB/zPGyyFQrtoqvuDiTaRzl2zSA/ av7yslcxPvIqg== From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Jason A . Donenfeld " Subject: [PATCH v3 2/3] crypto: lib - move __crypto_xor into utils Date: Mon, 25 Jul 2022 11:36:35 -0700 Message-Id: <20220725183636.97326-3-ebiggers@kernel.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220725183636.97326-1-ebiggers@kernel.org> References: <20220725183636.97326-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Eric Biggers CRYPTO_LIB_CHACHA depends on CRYPTO for __crypto_xor, defined in crypto/algapi.c. This is a layering violation because the dependencies should only go in the other direction (crypto/ =3D> lib/crypto/). Also the correct dependency would be CRYPTO_ALGAPI, not CRYPTO. Fix this by moving __crypto_xor into the utils module in lib/crypto/. Note that CRYPTO_LIB_CHACHA_GENERIC selected XOR_BLOCKS, which is unrelated and unnecessary. It was perhaps thought that XOR_BLOCKS was needed for __crypto_xor, but that's not the case. Signed-off-by: Eric Biggers Reviewed-by: Jason A. Donenfeld --- crypto/algapi.c | 71 ------------------------------------ lib/crypto/Kconfig | 3 +- lib/crypto/Makefile | 2 +- lib/crypto/memneq.c | 2 -- lib/crypto/utils.c | 88 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 90 insertions(+), 76 deletions(-) create mode 100644 lib/crypto/utils.c diff --git a/crypto/algapi.c b/crypto/algapi.c index d1c99288af3e0d..5c69ff8e8fa5c1 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c @@ -997,77 +997,6 @@ void crypto_inc(u8 *a, unsigned int size) } EXPORT_SYMBOL_GPL(crypto_inc); =20 -void __crypto_xor(u8 *dst, const u8 *src1, const u8 *src2, unsigned int le= n) -{ - int relalign =3D 0; - - if (!IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) { - int size =3D sizeof(unsigned long); - int d =3D (((unsigned long)dst ^ (unsigned long)src1) | - ((unsigned long)dst ^ (unsigned long)src2)) & - (size - 1); - - relalign =3D d ? 1 << __ffs(d) : size; - - /* - * If we care about alignment, process as many bytes as - * needed to advance dst and src to values whose alignments - * equal their relative alignment. This will allow us to - * process the remainder of the input using optimal strides. - */ - while (((unsigned long)dst & (relalign - 1)) && len > 0) { - *dst++ =3D *src1++ ^ *src2++; - len--; - } - } - - while (IS_ENABLED(CONFIG_64BIT) && len >=3D 8 && !(relalign & 7)) { - if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) { - u64 l =3D get_unaligned((u64 *)src1) ^ - get_unaligned((u64 *)src2); - put_unaligned(l, (u64 *)dst); - } else { - *(u64 *)dst =3D *(u64 *)src1 ^ *(u64 *)src2; - } - dst +=3D 8; - src1 +=3D 8; - src2 +=3D 8; - len -=3D 8; - } - - while (len >=3D 4 && !(relalign & 3)) { - if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) { - u32 l =3D get_unaligned((u32 *)src1) ^ - get_unaligned((u32 *)src2); - put_unaligned(l, (u32 *)dst); - } else { - *(u32 *)dst =3D *(u32 *)src1 ^ *(u32 *)src2; - } - dst +=3D 4; - src1 +=3D 4; - src2 +=3D 4; - len -=3D 4; - } - - while (len >=3D 2 && !(relalign & 1)) { - if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) { - u16 l =3D get_unaligned((u16 *)src1) ^ - get_unaligned((u16 *)src2); - put_unaligned(l, (u16 *)dst); - } else { - *(u16 *)dst =3D *(u16 *)src1 ^ *(u16 *)src2; - } - dst +=3D 2; - src1 +=3D 2; - src2 +=3D 2; - len -=3D 2; - } - - while (len--) - *dst++ =3D *src1++ ^ *src2++; -} -EXPORT_SYMBOL_GPL(__crypto_xor); - unsigned int crypto_alg_extsize(struct crypto_alg *alg) { return alg->cra_ctxsize + diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig index b09d9d6546cbc3..7e9683e9f5c636 100644 --- a/lib/crypto/Kconfig +++ b/lib/crypto/Kconfig @@ -36,7 +36,7 @@ config CRYPTO_ARCH_HAVE_LIB_CHACHA =20 config CRYPTO_LIB_CHACHA_GENERIC tristate - select XOR_BLOCKS + select CRYPTO_LIB_UTILS help This symbol can be depended upon by arch implementations of the ChaCha library interface that require the generic code as a @@ -46,7 +46,6 @@ config CRYPTO_LIB_CHACHA_GENERIC =20 config CRYPTO_LIB_CHACHA tristate "ChaCha library interface" - depends on CRYPTO depends on CRYPTO_ARCH_HAVE_LIB_CHACHA || !CRYPTO_ARCH_HAVE_LIB_CHACHA select CRYPTO_LIB_CHACHA_GENERIC if CRYPTO_ARCH_HAVE_LIB_CHACHA=3Dn help diff --git a/lib/crypto/Makefile b/lib/crypto/Makefile index b956b3bae26aaf..c852f067ab0601 100644 --- a/lib/crypto/Makefile +++ b/lib/crypto/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 =20 obj-$(CONFIG_CRYPTO_LIB_UTILS) +=3D libcryptoutils.o -libcryptoutils-y :=3D memneq.o +libcryptoutils-y :=3D memneq.o utils.o =20 # chacha is used by the /dev/random driver which is always builtin obj-y +=3D chacha.o diff --git a/lib/crypto/memneq.c b/lib/crypto/memneq.c index f2098318428478..d1e8c86fbb0fcf 100644 --- a/lib/crypto/memneq.c +++ b/lib/crypto/memneq.c @@ -175,5 +175,3 @@ noinline unsigned long __crypto_memneq(const void *a, c= onst void *b, EXPORT_SYMBOL(__crypto_memneq); =20 #endif /* __HAVE_ARCH_CRYPTO_MEMNEQ */ - -MODULE_LICENSE("GPL"); diff --git a/lib/crypto/utils.c b/lib/crypto/utils.c new file mode 100644 index 00000000000000..53230ab1b19576 --- /dev/null +++ b/lib/crypto/utils.c @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Crypto library utility functions + * + * Copyright (c) 2006 Herbert Xu + */ + +#include +#include +#include + +/* + * XOR @len bytes from @src1 and @src2 together, writing the result to @dst + * (which may alias one of the sources). Don't call this directly; call + * crypto_xor() or crypto_xor_cpy() instead. + */ +void __crypto_xor(u8 *dst, const u8 *src1, const u8 *src2, unsigned int le= n) +{ + int relalign =3D 0; + + if (!IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) { + int size =3D sizeof(unsigned long); + int d =3D (((unsigned long)dst ^ (unsigned long)src1) | + ((unsigned long)dst ^ (unsigned long)src2)) & + (size - 1); + + relalign =3D d ? 1 << __ffs(d) : size; + + /* + * If we care about alignment, process as many bytes as + * needed to advance dst and src to values whose alignments + * equal their relative alignment. This will allow us to + * process the remainder of the input using optimal strides. + */ + while (((unsigned long)dst & (relalign - 1)) && len > 0) { + *dst++ =3D *src1++ ^ *src2++; + len--; + } + } + + while (IS_ENABLED(CONFIG_64BIT) && len >=3D 8 && !(relalign & 7)) { + if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) { + u64 l =3D get_unaligned((u64 *)src1) ^ + get_unaligned((u64 *)src2); + put_unaligned(l, (u64 *)dst); + } else { + *(u64 *)dst =3D *(u64 *)src1 ^ *(u64 *)src2; + } + dst +=3D 8; + src1 +=3D 8; + src2 +=3D 8; + len -=3D 8; + } + + while (len >=3D 4 && !(relalign & 3)) { + if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) { + u32 l =3D get_unaligned((u32 *)src1) ^ + get_unaligned((u32 *)src2); + put_unaligned(l, (u32 *)dst); + } else { + *(u32 *)dst =3D *(u32 *)src1 ^ *(u32 *)src2; + } + dst +=3D 4; + src1 +=3D 4; + src2 +=3D 4; + len -=3D 4; + } + + while (len >=3D 2 && !(relalign & 1)) { + if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)) { + u16 l =3D get_unaligned((u16 *)src1) ^ + get_unaligned((u16 *)src2); + put_unaligned(l, (u16 *)dst); + } else { + *(u16 *)dst =3D *(u16 *)src1 ^ *(u16 *)src2; + } + dst +=3D 2; + src1 +=3D 2; + src2 +=3D 2; + len -=3D 2; + } + + while (len--) + *dst++ =3D *src1++ ^ *src2++; +} +EXPORT_SYMBOL_GPL(__crypto_xor); + +MODULE_LICENSE("GPL"); --=20 2.37.0 From nobody Wed Apr 15 05:38:01 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AAD0C433EF for ; Mon, 25 Jul 2022 18:36:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236213AbiGYSgz (ORCPT ); Mon, 25 Jul 2022 14:36:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236042AbiGYSgv (ORCPT ); Mon, 25 Jul 2022 14:36:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96FD61263D; Mon, 25 Jul 2022 11:36:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3695260B55; Mon, 25 Jul 2022 18:36:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85D24C341D0; Mon, 25 Jul 2022 18:36:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658774209; bh=mA3aiYbCg1RFcIAqL21d0TvLx6LId+F1ynP5gxcWKis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lHdt22eSL1YZ4JLiRkWotwA7r7sZ0hpDIDz0Y1NwZatcdfP29QNwKp5DpTpoxZQTd G7Of5r/Qp/uE7sE+lkEn75j6EMZ8hYpLKL2MMAwj2XxkBBDU4+Fo7F38IbwkM945bh ukzcyv/vHBxIquUbf1fPzAgRisukeG0ViNKKk0Ht7EU+oiBMqg6qpomZAtaQGNX3RX HF6eKYkqObAG7dfXyx0GxpQta+DOIO7DeWV2kXKkyHjV0AEaChm5k2PaE/8dV8Z7CW bQudPr3xB7LxxpV+hWCHBAlfAazhe5X3s3ehwg9NFo1Bfu2xxSSROZSHr8Cb/BzG5A q1K+I5LGIdoww== From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "Jason A . Donenfeld " Subject: [PATCH v3 3/3] crypto: lib - remove __HAVE_ARCH_CRYPTO_MEMNEQ Date: Mon, 25 Jul 2022 11:36:36 -0700 Message-Id: <20220725183636.97326-4-ebiggers@kernel.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220725183636.97326-1-ebiggers@kernel.org> References: <20220725183636.97326-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Eric Biggers No architecture actually defines this, so it's unneeded. Signed-off-by: Eric Biggers Reviewed-by: Jason A. Donenfeld --- lib/crypto/memneq.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/crypto/memneq.c b/lib/crypto/memneq.c index d1e8c86fbb0fcf..243d8677cc515d 100644 --- a/lib/crypto/memneq.c +++ b/lib/crypto/memneq.c @@ -63,8 +63,6 @@ #include #include =20 -#ifndef __HAVE_ARCH_CRYPTO_MEMNEQ - /* Generic path for arbitrary size */ static inline unsigned long __crypto_memneq_generic(const void *a, const void *b, size_t size) @@ -173,5 +171,3 @@ noinline unsigned long __crypto_memneq(const void *a, c= onst void *b, } } EXPORT_SYMBOL(__crypto_memneq); - -#endif /* __HAVE_ARCH_CRYPTO_MEMNEQ */ --=20 2.37.0