Open mattlockyer opened 5 years ago
.getPublic()
return encoded public key, maybe will be correct:
const encryptionKey = ephemeral.derive(receiver.pub)
?
Maybe it's a misnomer but encryptionKey is a BN, it's already a point / public key
Yes, .derive
return X part of point as BN instance, but in same time .derive
expect point on input as instance, not encoded.
So you're saying the derive method expects a Point object X value and not the public address?
Thank you for trying to help... This would be interesting to try but it doesn't seem like the example ECDH given here:
I'm also having issues with X25519.derive()
getting different results than our Python implementation, using PyNaCl.
Is there any code example that can compatible with golang.org/x/crypto/curve25519 or https://github.com/CryptoEsel/js-x25519?
Ps: I have checked that the test in https://github.com/CryptoEsel/js-x25519/blob/master/test/vector.js is compatible with golang.org/x/crypto/curve25519.
I got the same problems. is there any solution yet?
I got the same problems. is there any solution yet?
Switch to other curve25519 project like https://github.com/CryptoEsel/js-x25519
Tried so many different combinations on the golang side and finally concluded it was this library.
I cannot get golang to produce the same result for
encryptionKey
using the standard golang.org/x/crypto/curve25519 library.Keys are the same on both sides.
My only assumption is that your curve implementation is off or is a different variant.
I switched to https://github.com/dchest/tweetnacl-js and used the keyPair + scalarMult with zero issues.
Maybe someone could illuminate me to the pitfalls of different implementations? If that is a thing? I'm new to the cryptography side of things but have been programming for some time.
Thank you!