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

Pre-compute root of unity in fr-form #491

Merged
merged 10 commits into from
Aug 16, 2024

Conversation

jtraglia
Copy link
Member

@jtraglia jtraglia commented Aug 15, 2024

This replaces SCALE2_ROOT_OF_UNITY in uint64s-form with ROOT_OF_UNITY in fr-form. I don't have a strong opinion about this, but I was hoping to simplify this. It should at least be moved outside of the header. I provide updated instructions (scripts) for generating this constant. Had to remove some tests for compute_roots_of_unity though.

I would prefer a C function which uses PRIMITIVE_ROOT_OF_UNITY and generates the root of unity with blst, but there isn't a blst_fr_pow function and it seems quite difficult (maybe impossible) to do so ourselves.

@jtraglia jtraglia requested a review from asn-d6 August 15, 2024 22:03
@asn-d6
Copy link
Contributor

asn-d6 commented Aug 16, 2024

This code has been around since 4844 and has been working nicely. I have a small preference for leaving old code sleep.

If you like this PR, how about you add a small C test that shows that the new value you added is the same value from the uint64 array? Just to show that the new code and the old code (that will be removed) do the same thing.

@jtraglia
Copy link
Member Author

If you like this PR, how about you add a small C test that shows that the new value you added is the same value from the uint64 array? Just to show that the new code and the old code (that will be removed) do the same thing.

Okay yeah, I'll make that test. I do like this PR.

@jtraglia
Copy link
Member Author

@asn-d6 Okay this should be ready now. I'm glad we added these tests back, good suggestion.

@asn-d6 asn-d6 merged commit 87bb61e into ethereum:main Aug 16, 2024
38 checks passed
@jtraglia jtraglia deleted the simple-root-of-unity branch August 16, 2024 13:45
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.

2 participants