aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-15 13:19:22 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-15 13:19:22 +0100
commit31265fee183928890620db6dac49aad2705d1df6 (patch)
tree6091a200b2b2a0a43b0ea40dc78b5f94f8d6646b /src/libcryptobox
parentafc42e7f860aa0552560acec89cf4f57ea84f8a7 (diff)
downloadrspamd-31265fee183928890620db6dac49aad2705d1df6.tar.gz
rspamd-31265fee183928890620db6dac49aad2705d1df6.zip
We can include either 64 or 32 bits versions of curve25519-donna.
Diffstat (limited to 'src/libcryptobox')
-rw-r--r--src/libcryptobox/curve25519/curve25519-donna-c64.c2
-rw-r--r--src/libcryptobox/curve25519/curve25519-donna.c2
-rw-r--r--src/libcryptobox/curve25519/curve25519.c12
3 files changed, 6 insertions, 10 deletions
diff --git a/src/libcryptobox/curve25519/curve25519-donna-c64.c b/src/libcryptobox/curve25519/curve25519-donna-c64.c
index a3a78fcdb..2d5b19b18 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 55d1d1730..0de4b73b0 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 df795a855..030c88537 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