Repair NativeClient support
This commit is contained in:
parent
bdf5c8246b
commit
492d4b1dd6
@ -37,7 +37,7 @@ randombytes_init_if_needed(void)
|
|||||||
{
|
{
|
||||||
if (implementation == NULL) {
|
if (implementation == NULL) {
|
||||||
implementation = RANDOMBYTES_DEFAULT_IMPLEMENTATION;
|
implementation = RANDOMBYTES_DEFAULT_IMPLEMENTATION;
|
||||||
implementation->stir();
|
randombytes_stir();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,6 +78,9 @@ randombytes_stir(void)
|
|||||||
{
|
{
|
||||||
#ifndef __EMSCRIPTEN__
|
#ifndef __EMSCRIPTEN__
|
||||||
randombytes_init_if_needed();
|
randombytes_init_if_needed();
|
||||||
|
if (implementation->stir != NULL) {
|
||||||
|
implementation->stir();
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
EM_ASM({
|
EM_ASM({
|
||||||
if (Module.getRandomValue === undefined) {
|
if (Module.getRandomValue === undefined) {
|
||||||
|
@ -33,6 +33,8 @@ static int randombytes_tests(void)
|
|||||||
|
|
||||||
#ifdef __EMSCRIPTEN__
|
#ifdef __EMSCRIPTEN__
|
||||||
assert(strcmp(randombytes_implementation_name(), "js") == 0);
|
assert(strcmp(randombytes_implementation_name(), "js") == 0);
|
||||||
|
#elif defined(__native_client__)
|
||||||
|
assert(strcmp(randombytes_implementation_name(), "nativeclient") == 0);
|
||||||
#else
|
#else
|
||||||
assert(strcmp(randombytes_implementation_name(), "sysrandom") == 0);
|
assert(strcmp(randombytes_implementation_name(), "sysrandom") == 0);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user