Repair NativeClient support

This commit is contained in:
Frank Denis
2016-04-18 21:40:18 +02:00
parent bdf5c8246b
commit 492d4b1dd6
2 changed files with 6 additions and 1 deletions
+4 -1
View File
@@ -37,7 +37,7 @@ randombytes_init_if_needed(void)
{
if (implementation == NULL) {
implementation = RANDOMBYTES_DEFAULT_IMPLEMENTATION;
implementation->stir();
randombytes_stir();
}
}
@@ -78,6 +78,9 @@ randombytes_stir(void)
{
#ifndef __EMSCRIPTEN__
randombytes_init_if_needed();
if (implementation->stir != NULL) {
implementation->stir();
}
#else
EM_ASM({
if (Module.getRandomValue === undefined) {
+2
View File
@@ -33,6 +33,8 @@ static int randombytes_tests(void)
#ifdef __EMSCRIPTEN__
assert(strcmp(randombytes_implementation_name(), "js") == 0);
#elif defined(__native_client__)
assert(strcmp(randombytes_implementation_name(), "nativeclient") == 0);
#else
assert(strcmp(randombytes_implementation_name(), "sysrandom") == 0);
#endif