From 2087db93e24f90c78267bb7de323f16c5deda7c3 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sat, 9 Aug 2014 17:30:55 +0300 Subject: [PATCH] 25519: Add valgrind test mode --- src/library/curve25519.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/library/curve25519.cpp b/src/library/curve25519.cpp index 1becbd5f..6c7d39a5 100644 --- a/src/library/curve25519.cpp +++ b/src/library/curve25519.cpp @@ -516,6 +516,17 @@ void curve25519_clamp(uint8_t* key) const uint8_t curve25519_base[32] = {9}; +#ifdef CURVE25519_VALGRIND_TEST + +int main() +{ + uint8_t buf[128]; + curve25519(buf+64, buf, buf+32); + std::cerr << buf[64] << std::endl; + return 0; +} + +#endif #ifdef CURVE25519_TEST_MODE #include @@ -541,6 +552,7 @@ int main() double tsum; double tsqr; uint64_t tmin = 999999999; + buf[32] = 9; fread(buf, 1, 32, fd); buf[0] &= 248;