linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	x86@kernel.org, linux-crypto@vger.kernel.org
Subject: [PATCH RFC 3/3] crypto: curve25519 - do not pollute dispatcher based on assembler
Date: Fri, 20 Mar 2020 18:49:45 -0600	[thread overview]
Message-ID: <20200321004945.451497-4-Jason@zx2c4.com> (raw)
In-Reply-To: <20200321004945.451497-1-Jason@zx2c4.com>

Since we're doing a static inline dispatch here, we normally branch
based on whether or not there's an arch implementation. That would have
been fine in general, except the crypto Makefile prior used to turn
things off -- despite the Kconfig -- resulting in us needing to also
hard code various assembler things into the dispatcher too. The horror!
Now that the assembler config options are done by Kconfig, we can get
rid of the inconsistency.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 include/crypto/curve25519.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/crypto/curve25519.h b/include/crypto/curve25519.h
index 9ecb3c1f0f15..4e6dc840b159 100644
--- a/include/crypto/curve25519.h
+++ b/include/crypto/curve25519.h
@@ -33,8 +33,7 @@ bool __must_check curve25519(u8 mypublic[CURVE25519_KEY_SIZE],
 			     const u8 secret[CURVE25519_KEY_SIZE],
 			     const u8 basepoint[CURVE25519_KEY_SIZE])
 {
-	if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519) &&
-	    (!IS_ENABLED(CONFIG_CRYPTO_CURVE25519_X86) || IS_ENABLED(CONFIG_AS_ADX)))
+	if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519))
 		curve25519_arch(mypublic, secret, basepoint);
 	else
 		curve25519_generic(mypublic, secret, basepoint);
@@ -50,8 +49,7 @@ __must_check curve25519_generate_public(u8 pub[CURVE25519_KEY_SIZE],
 				    CURVE25519_KEY_SIZE)))
 		return false;
 
-	if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519) &&
-	    (!IS_ENABLED(CONFIG_CRYPTO_CURVE25519_X86) || IS_ENABLED(CONFIG_AS_ADX)))
+	if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519))
 		curve25519_base_arch(pub, secret);
 	else
 		curve25519_generic(pub, secret, curve25519_base_point);
-- 
2.25.1


  parent reply	other threads:[~2020-03-21  0:50 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-16  8:49 [GIT PULL] Crypto Update for 5.4 Herbert Xu
2019-09-18 19:55 ` pr-tracker-bot
2019-09-23  5:05 ` [GIT PULL] Crypto Fixes " Herbert Xu
2019-09-23 16:50   ` pr-tracker-bot
2019-10-10 12:38   ` Herbert Xu
2019-10-10 15:45     ` pr-tracker-bot
2019-11-17  1:00     ` Herbert Xu
2019-11-17  2:35       ` pr-tracker-bot
2019-12-02  6:20   ` [GIT PULL] Crypto Fixes for 5.5 Herbert Xu
2019-12-03  1:30     ` pr-tracker-bot
2019-12-14  8:47     ` Herbert Xu
2019-12-14 22:05       ` pr-tracker-bot
2020-01-15 15:08       ` Herbert Xu
2020-01-15 19:35         ` pr-tracker-bot
2020-02-13  3:32         ` [GIT PULL] Crypto Fixes for 5.6 Herbert Xu
2020-02-13 22:40           ` pr-tracker-bot
2020-02-24  6:00           ` Herbert Xu
2020-02-24 20:25             ` pr-tracker-bot
2020-03-12 11:57             ` Herbert Xu
2020-03-12 16:40               ` Linus Torvalds
2020-03-13  5:27                 ` Masahiro Yamada
2020-03-20 23:53                 ` Jason A. Donenfeld
2020-03-21 15:43                   ` Linus Torvalds
2020-03-21  0:49                 ` [PATCH RFC 0/3] x86: probe for assembler capabilities in Kconfig Jason A. Donenfeld
2020-03-21  0:49                   ` [PATCH RFC 1/3] x86: probe assembler instead of kconfig instead of makefile Jason A. Donenfeld
2020-03-21  0:49                   ` [PATCH RFC 2/3] crypto: x86 - rework configuration based on Kconfig Jason A. Donenfeld
2020-03-21  0:49                   ` Jason A. Donenfeld [this message]
2020-03-12 17:05               ` [GIT PULL] Crypto Fixes for 5.6 pr-tracker-bot
2020-03-23 22:54               ` Herbert Xu
2020-03-23 23:05                 ` pr-tracker-bot
2020-04-08  6:15           ` [GIT PULL] Crypto Fixes for 5.7 Herbert Xu
2020-04-09  4:55             ` pr-tracker-bot
2020-04-29  5:54             ` Herbert Xu
2020-04-29 16:50               ` pr-tracker-bot
2020-05-06  5:10               ` Herbert Xu
2020-05-06 17:25                 ` pr-tracker-bot
2020-06-11  4:05             ` [GIT PULL] Crypto Fixes for 5.8 Herbert Xu
2020-06-11 18:25               ` pr-tracker-bot
2020-06-21  8:23               ` Herbert Xu
2020-06-21 17:10                 ` pr-tracker-bot
2020-06-29  2:16                 ` Herbert Xu
2020-06-29 17:15                   ` pr-tracker-bot
2020-08-14 13:18               ` [GIT PULL] Crypto Fixes for 5.9 Herbert Xu
2020-08-14 20:34                 ` pr-tracker-bot
2019-11-25  3:45 ` [GIT PULL] Crypto Update for 5.5 Herbert Xu
2019-11-26  4:25   ` pr-tracker-bot
2020-01-28  5:03   ` [GIT PULL] Crypto Update for 5.6 Herbert Xu
2020-01-29  0:30     ` pr-tracker-bot
2020-04-01  4:27     ` [GIT PULL] Crypto Update for 5.7 Herbert Xu
2020-04-01 22:35       ` pr-tracker-bot
2020-06-01  2:45       ` [GIT PULL] Crypto Update for 5.8 Herbert Xu
2020-06-01 19:35         ` pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200321004945.451497-4-Jason@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).