diff options
author | Jeffrey Walton <noloader@gmail.com> | 2018-12-13 20:34:39 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-12-13 20:34:39 -0500 |
commit | 6dc60888d9bb2878a54751b2500bd9147b9c688e (patch) | |
tree | 70ea1c62f44844cedc40fbc29e12ed6bfffa6fc5 /donna_32.cpp | |
parent | 8c3432473b9cad297f179d324f0dc874406432f0 (diff) | |
download | cryptopp-git-6dc60888d9bb2878a54751b2500bd9147b9c688e.tar.gz |
Fix the cut-in of Moon's implementation (GH #761)
The initial cut-in was missing preamble present in Moon's curve25519_donna function. It originally tested good because we only perform a pairwise consistency check in release builds. Comprehensive testing with debug builds revealed the problem. Debug builds cross-validate against Bernstein's TweetNaCl library.
Diffstat (limited to 'donna_32.cpp')
-rw-r--r-- | donna_32.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/donna_32.cpp b/donna_32.cpp index 5f86c29a..b6c8fac3 100644 --- a/donna_32.cpp +++ b/donna_32.cpp @@ -10,23 +10,13 @@ #include "config.h"
#include "donna.h"
#include "secblock.h"
-#include "stdcpp.h"
#include "misc.h"
#include "cpu.h"
-// This macro is not in a header like config.h because we don't want it
-// exposed to user code. We also need a standard header like <stdint.h>
-// or <stdef.h>.
-#if (UINTPTR_MAX == 0xffffffff) || !defined(CRYPTOPP_WORD128_AVAILABLE)
-# define CRYPTOPP_32BIT 1
-#else
-# define CRYPTOPP_64BIT 1
-#endif
-
// Squash MS LNK4221 and libtool warnings
extern const char DONNA32_FNAME[] = __FILE__;
-#if defined(CRYPTOPP_32BIT)
+#if defined(CRYPTOPP_CURVE25519_32BIT)
ANONYMOUS_NAMESPACE_BEGIN
@@ -546,4 +536,4 @@ int curve25519(byte sharedKey[32], const byte secretKey[32], const byte othersKe NAMESPACE_END // Donna
NAMESPACE_END // CryptoPP
-#endif // CRYPTOPP_32BIT
+#endif // CRYPTOPP_CURVE25519_32BIT
|