Skip to content

Commit 3f523e1

Browse files
zx2c4masahir0y
authored andcommitted
crypto: curve25519 - do not pollute dispatcher based on assembler
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 <[email protected]> Acked-by: Herbert Xu <[email protected]> Acked-by: Ingo Molnar <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 4dcbfc3 commit 3f523e1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

include/crypto/curve25519.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ bool __must_check curve25519(u8 mypublic[CURVE25519_KEY_SIZE],
3333
const u8 secret[CURVE25519_KEY_SIZE],
3434
const u8 basepoint[CURVE25519_KEY_SIZE])
3535
{
36-
if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519) &&
37-
(!IS_ENABLED(CONFIG_CRYPTO_CURVE25519_X86) || IS_ENABLED(CONFIG_AS_ADX)))
36+
if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519))
3837
curve25519_arch(mypublic, secret, basepoint);
3938
else
4039
curve25519_generic(mypublic, secret, basepoint);
@@ -50,8 +49,7 @@ __must_check curve25519_generate_public(u8 pub[CURVE25519_KEY_SIZE],
5049
CURVE25519_KEY_SIZE)))
5150
return false;
5251

53-
if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519) &&
54-
(!IS_ENABLED(CONFIG_CRYPTO_CURVE25519_X86) || IS_ENABLED(CONFIG_AS_ADX)))
52+
if (IS_ENABLED(CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519))
5553
curve25519_base_arch(pub, secret);
5654
else
5755
curve25519_generic(pub, secret, curve25519_base_point);

0 commit comments

Comments
 (0)