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

Implementation of Pallas #14

Merged
merged 2 commits into from
Apr 21, 2021
Merged

Implementation of Pallas #14

merged 2 commits into from
Apr 21, 2021

Conversation

str4d
Copy link
Contributor

@str4d str4d commented Feb 25, 2021

No description provided.

@str4d str4d changed the title Orchard test vectors Implementation of Pallas Apr 20, 2021
@str4d str4d marked this pull request as ready for review April 20, 2021 22:31
@str4d
Copy link
Contributor Author

str4d commented Apr 20, 2021

This PR now just covers the Pallas implementation. Test vectors are in subsequent PRs like #17.

@str4d str4d added this to the Core Sprint 2021-14 milestone Apr 20, 2021
Copy link
Contributor

@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.

ACK

Copy link

@ebfull ebfull left a comment

Choose a reason for hiding this comment

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

ACK with non-blocking comments/nits.

Comment on lines +141 to +144
def __init__(self, x, y):
self.x = x
self.y = y
self.is_identity = False
Copy link

Choose a reason for hiding this comment

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

Would be cool to have an is_on_curve assertion here; y^2 == x^3 + b.

assert Point.ZERO + Point.ZERO == Point.ZERO
assert Point.GENERATOR - Point.GENERATOR == Point.ZERO
assert Point.GENERATOR + Point.GENERATOR + Point.GENERATOR == Point.GENERATOR * Scalar(3)
assert Point.GENERATOR + Point.GENERATOR - Point.GENERATOR == Point.GENERATOR
Copy link

Choose a reason for hiding this comment

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

A good test is assert (-Point.GENERATOR) == Point.GENERATOR * -Scalar(-1).

@str4d
Copy link
Contributor Author

str4d commented Apr 21, 2021

Will address @ebfull's nits in a follow-up PR, since I don't trust GitHub to switch the base of #17 correctly if I push additional commits to this PR.

@str4d str4d merged commit c3b4e45 into master Apr 21, 2021
@str4d str4d deleted the orchard branch April 21, 2021 00:09
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.

4 participants