mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-19 18:15:18 -07:00
Repair NativeClient support
This commit is contained in:
parent
bdf5c8246b
commit
492d4b1dd6
@ -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) {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user