sodium-javascript icon indicating copy to clipboard operation
sodium-javascript copied to clipboard

WIP Fixing Noise handshake issue

Open fix opened this issue 6 months ago • 2 comments

I can confirm i managed to fix https://github.com/holepunchto/hypercore/issues/452 namely this error.

Noise handshake failed
    at NoiseSecretStream._onhandshakert (bundle.js?t=1699883966724:403:33)
    at NoiseSecretStream._open (bundle.js?t=1699883966724:451:32)
    at WritableState.updateNonPrimary (bundle.js?t=1699883966724:21823:14)
    at WritableState.update (bundle.js?t=1699883966724:21798:72)
    at WritableState.updateWriteNT (bundle.js?t=1699883966724:22147:10)

The PR is self explanatory.

fix avatar Oct 08 '25 13:10 fix

still WIP, i discovered there was a missing implementation crypto_scalarmult_ed25519_noclamp that is added now

however somehow debugging the code, it sounds the noise handshake fails now because of verification fail here, where the computed mac is not the one expected

https://github.com/sodium-friends/sodium-javascript/blob/f19e6c81720f596ec966dd1c9c1aba0f8f80edb5/crypto_aead.js#L129

not sure if this is related...

fix avatar Oct 09 '25 09:10 fix

ok bummer, i used curve25519 instead of ed25519, working on it

fix avatar Oct 09 '25 09:10 fix