1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00

randombytes test: restore the salsa20-based rng at the end, for benchmarks

This commit is contained in:
Frank Denis 2017-08-04 23:01:16 +02:00
parent a8cc1634f4
commit 8813c36fff

View File

@ -39,12 +39,14 @@ randombytes_tests(void)
unsigned int i;
uint32_t n;
#ifdef __EMSCRIPTEN__
#ifndef BENCHMARKS
# ifdef __EMSCRIPTEN__
assert(strcmp(randombytes_implementation_name(), "js") == 0);
#elif defined(__native_client__)
# elif defined(__native_client__)
assert(strcmp(randombytes_implementation_name(), "nativeclient") == 0);
#else
# else
assert(strcmp(randombytes_implementation_name(), "sysrandom") == 0);
# endif
#endif
randombytes(x, 1U);
do {
@ -158,5 +160,7 @@ main(void)
#endif
printf("OK\n");
randombytes_set_implementation(&randombytes_salsa20_implementation);
return 0;
}