Comments (7)
Browser core is very dependant on sodium-browserify to have web assembly working. JS is insanely slow compared to web assembly. So I don't really care about tweetnacl. I would actually like to get rid of tweetnacl as that makes the bundle smaller. So big +1 from me :-) Great work @christianbundy.
And thanks for the ping @staltz I didn't have notifications turned on for this repo until now.
from chloride.
🎉
All of our required functionality has been released in Sodium-Javascript!
from chloride.
I didn't realize that we actually have at least three providers:
- Browser:
- Big: libsodium-wrappers (emscripten)
- Small: TweetNaCl
- Node.js: Sodium-Native
I took the various chloride-* modules and pulled their histories together to create one (much smaller) repository that uses Sodium-Universal, but unfortunately there are a few functions missing. More info here: sodium-friends/sodium-javascript#19
Here's my branch: https://github.com/christianbundy/chloride/tree/sodium-universal
Compatibility:
- crypto_sign_PUBLICKEYBYTES
- crypto_sign_SECRETKEYBYTES
- crypto_sign_seed_keypair
- crypto_sign_keypair
- crypto_sign_BYTES
- crypto_sign
- crypto_sign_open
- crypto_sign_detached
- crypto_sign_verify_detached
- crypto_box_PUBLICKEYBYTES
- crypto_box_SECRETKEYBYTES
- crypto_box_seed_keypair
- crypto_box_keypair
- crypto_box_MACBYTES
- crypto_box_easy
- crypto_box_open_easy
- crypto_secretbox_easy
- crypto_secretbox_open_easy
- crypto_auth_BYTES
- crypto_auth
- crypto_auth_verify
- crypto_hash_BYTES
- crypto_hash
- crypto_hash_sha256_BYTES
- crypto_hash_sha256
- crypto_scalarmult_BYTES
- crypto_box_PUBLICKEYBYTES
- crypto_sign_ed25519_pk_to_curve25519
- crypto_box_SECRETKEYBYTES
- randombytes_buf
from chloride.
@arj03 What are you relying on in the SSB browser demo?
from chloride.
Sweet. I'm curious to benchmark libsodium-wrappers (emscripten) vs sodium-javascript (handwritten) once all of the methods are ported. If we can just depend on sodium-universal that'd remove lots of complexity from this module and consolidate our libsodium dependencies to the sodium-friends org.
from chloride.
I ran sodiumperf against libsodium-wrappers and sodium-javascript and it looks like this might actually give us a nice performance boost:
(This assumes that my PRs into sodium-javascript are merged, and currently leaves out crypto_sign_ed25519_pk_to_curve25519
because I've only written tests, not the implementation.)
from chloride.
Have read this, but haven't got super familiar with details. Please tag me if you need my attention on this.
FWIW I'm mainly using graphql to connect from browser to back end, so don't use eg ssb-client which needs this much.
Happy to trust your expertise
from chloride.
Related Issues (12)
- What is the relationship of this project to paixaop/node-sodium? HOT 6
- wasm variant is being irregularly picked HOT 5
- doesn't work in browser HOT 3
- node v12 support HOT 1
- chloride launches electron every time it's required HOT 1
- Is Electron workaround still necessary? HOT 2
- Tests not currently passing HOT 5
- cannot support platform=android and arch=arm64 HOT 1
- Converting ed25519 does not throw in browser HOT 6
- Replace sodium-prebuilt with sodium-native HOT 4
- mind pushing code for 2.2.7 to github? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chloride.