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

Replace ELEMENT_UPPER_BOUND by FieldElement::MAX in ecdsa #566

Closed
wants to merge 2 commits into from

Conversation

tcoratger
Copy link
Collaborator

Description:
In the FieldElement module, we've already defined a Max field to indicate the maximum value a field element can take before the modulus is reached, specifically equal to 2^251 + 17 * 2^192. Consequently, there's no need to redefine this value in the crypto ecdsa file. By leveraging the existing definition from FieldElement, we can ensure consistency and avoid redundancy in our codebase.

@tcoratger tcoratger closed this Mar 11, 2024
@tcoratger
Copy link
Collaborator Author

Closed, didn't read well the diff between ELEMENT_UPPER_BOUND which is 2 ** N_ELEMENT_BITS_ECDSA and FieldElement::MAX which is Modulo minus 1.

@xJonathanLEI
Copy link
Owner

Yep yep. IIRC this was done specifically to align with the official impl from the StarkWare C++ lib back in the day.

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