vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c in rbnacl-libsodium-1.0.15.1 vs vendor/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c in rbnacl-libsodium-1.0.16

- old
+ new

@@ -1,22 +1,17 @@ #include "crypto_scalarmult_curve25519.h" +#include "private/implementations.h" #include "scalarmult_curve25519.h" #include "runtime.h" #ifdef HAVE_AVX_ASM # include "sandy2x/curve25519_sandy2x.h" #endif -#ifdef HAVE_TI_MODE -# include "donna_c64/curve25519_donna_c64.h" +#include "ref10/x25519_ref10.h" static const crypto_scalarmult_curve25519_implementation *implementation = - &crypto_scalarmult_curve25519_donna_c64_implementation; -#else -# include "ref10/x25519_ref10.h" -static const crypto_scalarmult_curve25519_implementation *implementation = &crypto_scalarmult_curve25519_ref10_implementation; -#endif int crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n, const unsigned char *p) { @@ -51,14 +46,11 @@ } int _crypto_scalarmult_curve25519_pick_best_implementation(void) { -#ifdef HAVE_TI_MODE - implementation = &crypto_scalarmult_curve25519_donna_c64_implementation; -#else implementation = &crypto_scalarmult_curve25519_ref10_implementation; -#endif + #ifdef HAVE_AVX_ASM if (sodium_runtime_has_avx()) { implementation = &crypto_scalarmult_curve25519_sandy2x_implementation; } #endif