Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ed25519: fix edwardsToMontgomery formula; implement edwardsToMontgomeryPriv #32

Merged
merged 1 commit into from
Apr 23, 2023

Conversation

mirceanis
Copy link
Contributor

fixes #31

This fixes the formula used in edwardsToMontgomery.
I also implemented the equivalent transformation for private keys edwardsToMontgomeryPriv and added a bunch of tests.

Is there a reason ed25519-addons.test.js wasn't being run during npm test ? I included it as well.

My IDE rearranged the imports and whitespace to fit prettier rules. If that's an issue I can revert.

@ukstv
Copy link

ukstv commented Apr 20, 2023

@mirceanis Hahaha, was about to make a PR for exactly the same issue! Discovered wrong formula while trying to replace stablelib dependencies with @noble/curves. You made it first!

@ukstv
Copy link

ukstv commented Apr 21, 2023

Hey @paulmillr do you think you could address the issue we discovered here so that we could further adopt noble-crypto in DID-related realm?

@paulmillr
Copy link
Owner

Thanks,

Could you add an alias for edwardsToMontgomery called edwardsToMontgomeryPub? We will keep the old name for backwards compat for now.

I also assume the new priv function is the same as ed25519.utils.getExtendedPublicKey().head? And could be replaced with it?

@paulmillr paulmillr merged commit b2a04c2 into paulmillr:main Apr 23, 2023
@paulmillr
Copy link
Owner

renamed manually

@mirceanis mirceanis deleted the 31-fix-edwardsToMontgomery branch May 4, 2023 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ed25519 edwardsToMontgomery does not produce correct output
3 participants