Closed bschick closed 3 weeks ago
Can you try the current code? The aegis functions are now in standard packages. Additionally, new emscripten versions removed support for a command-line flag we were using, which may have prevented some updates.
Cloning the libsodium.js repo and using code from /dist/modules I did get aegis functions to work in a nodejs project with the non-sumo files.
The crypto_kdf_hkdf functions I tested still do not work, for example:
TypeError: sodium.crypto_kdf_hkdf_sha256_extract is not a function
at /home/bschick/shared/lstest/index.js:30:19
In a browser project using angular and typescript, I have not gotten the aegis functions to work yet using the cloned repo, but I may be doing something wrong since I have not built the npm packages and installed them properly (I just replaced the project's node_module files with those from libsodium.js repo's /dist/modules, and cleared caches). The error is:
TypeError: libsodium_wrappers__WEBPACK_IMPORTED_MODULE_1___default(...).crypto_aead_aegis256_encrypt is not a function
@jedisct1 anything else you'd like me to try?
Looks like Javascript wrappers for these functions don't exist, so they have to be written 🤷
I figured out the local problem with crypto_aead_aegis functions not working in a browser project. So we can limit this report to just the missing crypto_kdf_hkdf wrappers. If I get time and the full build working, I'll work on that
While working on this issue: https://github.com/jedisct1/libsodium.js/issues/334 I hit errors trying to call the following 1.0.19 functions from plain old javascript:
crypto_aeadaegis128l crypto_aeadaegis256 crypto_kdfhkdf*
After some grepping and simple tests, it looks like:
sodium.ready.then( () => { let k1 = sodium.crypto_aead_aegis256_keygen(); console.log(k1); })
TypeError: sodium.crypto_aead_aegis256_keygen is not a function at /home/bschick/shared/lstest/index.js: