-
I have written a small test that generates keys and a signature in the browser, then sends this to a backend written in Rust (using axum, data_encoding and ed25519_dalek libraries); Unfortunately, the signature does not verify on the backend and of course if I sign it using the same keys using the Rust libary the signature does not match. I have not been able to identify the reason. I have tried to validate if possibly it was an endian issue, so I attempted reversing key keys and signature in Javascript before sending, but this only resulted in errors in Rust indicating that this was likely not the issue. I have not yet attempted using hex instead of u8arrays to see if this makes a difference. That will be my next testing. I have uploaded my sample test files to this repo: https://github.com/jcdc404/edwards_test Javascript--
sVRKnPVe8qqFk7x80gbLLSDLAK9KHdch3c1XX2NgqbS2h6MXqn67XbVNxw1GcTGHgz5RPC+9yJrkxHito1tfBA== index.js:25:33 RUST--
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This is incorrect: So you are passing different inputs to ed25519, which is why it doesn't match. To convert text to Uint8Array, use |
Beta Was this translation helpful? Give feedback.
This is incorrect:
Uint8Array.from("testing")
. It will produce a bunch of zeros. You can do this with Buffer, but Uint8Array is not buffer.So you are passing different inputs to ed25519, which is why it doesn't match.
To convert text to Uint8Array, use
new TextEncoder().encode(text)
.