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

Use montgomery form to store baby bear field elements #247

Merged
merged 1 commit into from Aug 19, 2022
Merged

Conversation

shkoo
Copy link
Contributor

@shkoo shkoo commented Aug 19, 2022

This matches what C++ uses, and it's faster!

This matches what C++ uses, and it's faster!
@shkoo shkoo marked this pull request as ready for review August 19, 2022 20:05
Copy link
Member

@tzerrell tzerrell left a comment

Choose a reason for hiding this comment

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

Great! I have one inline question, which might be most straightforward to verify by simply adding a test that repeated addition is the same as multiplication, e.g. take a field element about half the size of the prime, add it to itself ten times, and test that that's the same as multiplying that element by 10.

risc0/zkp/rust/src/field/baby_bear.rs Show resolved Hide resolved
@shkoo shkoo merged commit 80ff687 into main Aug 19, 2022
@shkoo shkoo deleted the nils/montgomery branch August 19, 2022 21:39
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

2 participants