25519: Add valgrind test mode
This commit is contained in:
parent
5c84507e22
commit
2087db93e2
1 changed files with 12 additions and 0 deletions
|
@ -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 <cmath>
|
||||
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue