You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**exceptionerror: {error,{"libdecaf/c_src/nif/impl/ed255.c.h", 76},
"UNSAFE: Privkey and Pubkey are not part of the same keypair. See: https://github.com/MystenLabs/ed25519-unsafe-libs"}
The new keypair API in version 2.1.0 uses NIF resources which cannot be easily modified:
Hey @kchalkias,
Thank you for putting this together and helping to track everything.
I'm the maintainer of erlang-libdecaf and as of libdecaf 2.1.0 released earlier today, I think that this misuse bug has been fixed.
Although users can still call the old function, internally I'm performing a re-derivation of the public key and checking that it matches the provided public key. If they don't, it raises an exception along with a link to this repository: https://github.com/potatosalad/erlang-libdecaf/blob/2.1.0/c_src/nif/impl/ed255.c.h#L71-L80
A new keypair-based API has been provided, too, which does now allow users to pass different public keys along with the private key: https://github.com/potatosalad/erlang-libdecaf/blob/2.1.0/src/libdecaf_curve25519.erl#L144-L145
Example:
With libdecaf 1.0.0, the bug was present:
With libdecaf 2.0.0, the Erlang VM would be aborted due to the upstream ed448goldilocks library properly detecting this bug:
Finally, with libdecaf 2.1.0, an exception is raised:
The new keypair API in version 2.1.0 uses NIF resources which cannot be easily modified:
The text was updated successfully, but these errors were encountered: