randombytes_buf always generate 000000000000000000000000 #1340
Unanswered
qijun4tian
asked this question in
Q&A
Replies: 2 comments 3 replies
-
The library must be initialized with "sodium_init()" before calling any other function. On all platforms. |
Beta Was this translation helpful? Give feedback.
3 replies
-
3ks. i recompile it and is ok now, but i do not know why is was not ok before. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi
i want encrypt in brower and write clang use crypto_aead_chacha20poly1305_ietf_encrypt , use randombytes_buf to generate npub like below
and is work well on linux
so i generate the wasm file like below
emcc -O0 -s FORCE_FILESYSTEM=1 -s EXPORTED_FUNCTIONS='[_randombytes_buf,_main]' -s EXIT_RUNTIME=1 -I/root/libsodium-stable/src/libsodium/include /root/libsodium-stable/libsodium-js-sumo/lib/libsodium.a main.c -o output.html
i run the output.html and randombytes_buf always generate 000000000000000000000000
and also the brower console error
Uncaught TypeError: Module.getRandomValue is not a function
Beta Was this translation helpful? Give feedback.
All reactions