--- gvpe/src/curve25519.C 2013/07/17 04:36:03 1.2 +++ gvpe/src/curve25519.C 2015/01/17 08:35:16 1.5 @@ -36,7 +36,12 @@ #include "util.h" #include "curve25519.h" + +#if __GNUC__ >= 4 && __SIZEOF_LONG__ == 8 +#include "curve25519-donna-c64.c" +#else #include "curve25519-donna.c" +#endif static void curve25519_derive (const curve25519_key &a, curve25519_key &b) @@ -47,11 +52,13 @@ void curve25519_generate (curve25519_key &a, curve25519_key &b) { - RAND_bytes (a, sizeof a); + rand_fill (a); +#if 0 a [ 0] &= 0xf8; a [31] &= 0x7f; a [31] |= 0x40; +#endif curve25519_derive (a, b); }