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

Change generator in the Stark252PrimeField to one of maximal order $2^{192}$ #572

Merged
merged 3 commits into from
Sep 22, 2023

Conversation

schouhy
Copy link
Contributor

@schouhy schouhy commented Sep 22, 2023

Change generator in the Stark252PrimeField to one of maximal order $2^{192}$

Description

We were using a generator of a subgroup of order $2^{48}$. However, the largest power of 2 that divides p-1, where p is the prime of the Stark252PrimeField, is $2^{192}$. This PR sets the generator to be $3^{(p-1) / (2^{192})}$, laying the ground to have domains compatible with the Stone Prover.
Also, since 2^{192} does not fit in a usize, this PR slightly changes the way the method get_primitive_root_of_unity computes primitives by avoiding a call to pow and manually performing succesive squares of the original root.

@schouhy schouhy requested review from ajgara and a team as code owners September 22, 2023 01:29
@codecov-commenter
Copy link

codecov-commenter commented Sep 22, 2023

Codecov Report

Merging #572 (ac3fe08) into main (21cc017) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #572   +/-   ##
=======================================
  Coverage   95.46%   95.46%           
=======================================
  Files         112      112           
  Lines       18811    18812    +1     
=======================================
+ Hits        17957    17958    +1     
  Misses        854      854           
Files Changed Coverage Δ
...field/fields/fft_friendly/stark_252_prime_field.rs 88.09% <ø> (ø)
math/src/field/traits.rs 94.54% <100.00%> (+0.05%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@schouhy schouhy force-pushed the change-stark252field-generator branch from 33ab55d to ac3fe08 Compare September 22, 2023 01:38
@MauroToscano MauroToscano added this pull request to the merge queue Sep 22, 2023
Merged via the queue into main with commit ba2645c Sep 22, 2023
@MauroToscano MauroToscano deleted the change-stark252field-generator branch September 22, 2023 16:54
PatStiles pushed a commit to PatStiles/lambdaworks that referenced this pull request Sep 26, 2023
…^{192}$ (lambdaclass#572)

* use a generator of the 2-Sylow subgroup in the Stark252PrimeField

* use square
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.

5 participants