From: Vsevolod Stakhov Date: Thu, 15 Oct 2015 12:19:22 +0000 (+0100) Subject: We can include either 64 or 32 bits versions of curve25519-donna. X-Git-Tag: 1.0.6~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31265fee183928890620db6dac49aad2705d1df6;p=thirdparty%2Frspamd.git We can include either 64 or 32 bits versions of curve25519-donna. --- diff --git a/src/libcryptobox/curve25519/curve25519-donna-c64.c b/src/libcryptobox/curve25519/curve25519-donna-c64.c index a3a78fcdbf..2d5b19b180 100644 --- a/src/libcryptobox/curve25519/curve25519-donna-c64.c +++ b/src/libcryptobox/curve25519/curve25519-donna-c64.c @@ -477,7 +477,7 @@ static void crecip (felem out, const felem z) /* 2^255 - 21 */fmul (out, t0, a); } -int scalarmult_donna64 (u8 *mypublic, const u8 *secret, const u8 *basepoint) +int scalarmult_donna (u8 *mypublic, const u8 *secret, const u8 *basepoint) { limb bp[5], x[5], z[5], zmone[5]; unsigned char e[32]; diff --git a/src/libcryptobox/curve25519/curve25519-donna.c b/src/libcryptobox/curve25519/curve25519-donna.c index 55d1d1730d..0de4b73b02 100644 --- a/src/libcryptobox/curve25519/curve25519-donna.c +++ b/src/libcryptobox/curve25519/curve25519-donna.c @@ -891,7 +891,7 @@ static void crecip (limb *out, const limb *z) /* 2^255 - 21 */fmul (out, t1, z11); } -int scalarmult_donna32 (u8 *mypublic, const u8 *secret, const u8 *basepoint) +int scalarmult_donna (u8 *mypublic, const u8 *secret, const u8 *basepoint) { limb bp[10], x[10], z[11], zmone[10]; unsigned char e[32]; diff --git a/src/libcryptobox/curve25519/curve25519.c b/src/libcryptobox/curve25519/curve25519.c index df795a855c..030c885370 100644 --- a/src/libcryptobox/curve25519/curve25519.c +++ b/src/libcryptobox/curve25519/curve25519.c @@ -56,16 +56,12 @@ CURVE25519_DECLARE(avx); CURVE25519_DECLARE(ref); #define CURVE25519_REF CURVE25519_IMPL(0, "ref", ref) -#if !defined(__LP64__) -CURVE25519_DECLARE(donna32); -#define CURVE25519_GENERIC CURVE25519_IMPL(0, "donna32", donna32) -#else -CURVE25519_DECLARE(donna64); -#define CURVE25519_GENERIC CURVE25519_IMPL(0, "donna64", donna64) -#endif +CURVE25519_DECLARE(donna); +#define CURVE25519_DONNA CURVE25519_IMPL(0, "donna", donna) + static const curve25519_impl_t curve25519_list[] = { - CURVE25519_GENERIC, + CURVE25519_DONNA, #if defined(CURVE25519_AVX) CURVE25519_AVX, #endif