sodium-friends / sodium-javascript

Pure Javascript version of sodium-native
MIT License
92 stars 24 forks source link

History #30

Closed christianbundy closed 4 years ago

christianbundy commented 4 years ago

Hi. After spending a few hours working on this project I've found myself feeling curious about the history.

My best guess is that this is meant to be like TweetNaCl-JS except with a libsodium API, but I figure I should probably just ask rather than make assumptions. Thanks for the fun project!

emilbayes commented 4 years ago

Yeah so it's legacy is TweetNaCl which you can still find the original copyright for:

https://github.com/sodium-friends/sodium-javascript/blob/a546f3e51d4496b18f4d565339bd06c0ccbc0527/index.js#L3-L9

However we wanted to have a more modular browser version of libsodium, rather than emscripten version like libsodium.js, and then along the way wasm became an option. I think that's pretty much it?

The "ecosystem" here is:

Some newer goals are to conform to sodium-native returns, which TweetNaCl did not, make it modular so you can import the pieces you need, try to avoid Buffers to keep the browser bundle smaller, and have sensible assertions in the same manner as sodium-native

Hope that clears up a bit

christianbundy commented 4 years ago

Thanks, that does! I'll close this now, feel free to reopen if you'd like someone to add it to the readme.