-
Notifications
You must be signed in to change notification settings - Fork 728
Refactored EC-point point calculations. #9400
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
base: orizi/01-04-fixes_the_declared_returned_location_of_box-deconstruct
Are you sure you want to change the base?
Refactored EC-point point calculations. #9400
Conversation
SIERRA_UPDATE_PATCH_CHANGE_TAG=Refactoring unreleased function.
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Consider mentioning that alpha is 1. Code quote: /// The beta parameter of the curve.
const BETA: Felt252 = Felt252::from_hex_unchecked(
"0x6f21413efbe40de150e596d72f7a8c5609ad26c15c915c1f4cdfcb99cee9e89", |
ilyalesokhin-starkware
left a comment
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.
@ilyalesokhin-starkware reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @liorgold2 and @TomerStarkware).
TomerStarkware
left a comment
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.
@TomerStarkware reviewed all commit messages and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @liorgold2).

Summary
Refactored EC point validation and curve operations by extracting common elliptic curve functionality into the
EcPointTypestruct. Added utility methods for calculating curve points and validating if a point lies on the curve, replacing duplicated curve equation implementations across the codebase.Type of change
Please check one:
Why is this change needed?
The code had multiple implementations of the same elliptic curve operations scattered across different modules. This created maintenance issues and potential inconsistencies when working with EC points. By centralizing these operations in the
EcPointTypestruct, we ensure consistent behavior and make the code more maintainable.What was the behavior or documentation before?
Previously, the curve equation and validation logic was duplicated in multiple places, with hardcoded constants for the curve parameters appearing in both the runner and simulation code. This made it difficult to ensure consistent behavior across different parts of the codebase.
What is the behavior or documentation after?
Now all EC point operations use a centralized implementation in the
EcPointTypestruct, which provides methods for:This ensures consistent behavior across the codebase and simplifies maintenance.
Additional context
This refactoring improves code organization without changing functionality. The centralized implementation makes it easier to update curve operations if needed in the future.