-
Notifications
You must be signed in to change notification settings - Fork 323
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
chore: remove noir-lang/ec
dependency
#12507
base: master
Are you sure you want to change the base?
Conversation
cc @kashbrti as related to nixing the ec library |
noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr
Show resolved
Hide resolved
// as well as C3 = (C2 - 1)/2, where C2 = (p-1)/(2^c1), | ||
// and C5 = ZETA^C2, where ZETA is a non-square element of Field. | ||
// These are pre-computed above as globals. | ||
pub(crate) fn sqrt(x: Field) -> Field { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a fuzz test for the function?
we can just pick a field element x
, square them, and check that the sqrt is +-x
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can wait until we choose a final home for these functions. We're not losing any test coverage with this PR (pow and sqrt are completely untested inside of noir-lang/ec
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as these are functions on the native field type, shouldn't they naturally be in stdlib?
global C3: Field = 40770029410420498293352137776570907027550720424234931066070132305055; | ||
global C5: Field = 19103219067921713944291392827692070036145651957329286315305642004821462161904; | ||
|
||
pub(crate) fn pow(x: Field, y: Field) -> Field { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
noir-lang/ec
is a bad library and we're using it for non ec things. Let's take these non ec things out of the ec library and then not use the ec library.Maybe these non ec things can go into another place at some point... but today is not that day.