Giter Club home page Giter Club logo

Comments (7)

arj03 avatar arj03 commented on May 18, 2024 2

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.

christianbundy avatar christianbundy commented on May 18, 2024 2

🎉

All of our required functionality has been released in Sodium-Javascript!

from chloride.

christianbundy avatar christianbundy commented on May 18, 2024

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.

staltz avatar staltz commented on May 18, 2024

@arj03 What are you relying on in the SSB browser demo?

from chloride.

christianbundy avatar christianbundy commented on May 18, 2024

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.

christianbundy avatar christianbundy commented on May 18, 2024

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.

mixmix avatar mixmix commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.