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

Add daira's fast scalar multiplication #467

Merged
merged 2 commits into from
Apr 14, 2020
Merged

Conversation

imeckler
Copy link
Contributor

This PR implements Daira's fast scalar multiplication algorithm from here.

@mrmr1993 mrmr1993 merged commit 0407784 into master Apr 14, 2020
@mrmr1993 mrmr1993 deleted the feature/fast-scalar-mul branch April 14, 2020 19:22
Copy link

@daira daira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me (for short Weierstrass curves), modulo the comment about documenting the order of bits in r.

let n = Array.length r in
let acc = ref (double t) in
let () =
for i = 0 to n - 1 do
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is reversed relative to the zcash/zcash#3924 algorithm; it's probably just that r is MSB-first, but that isn't documented.

(Same in the current code.)

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.

None yet

3 participants