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

feat: add ec_mul #886

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

feat: add ec_mul #886

wants to merge 2 commits into from

Conversation

zmalatrax
Copy link
Contributor

Closes #853
Closes #854
Closes #178

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

Attention: Patch coverage is 30.27375% with 433 lines in your changes missing coverage. Please review.

Project coverage is 77.75%. Comparing base (891aa81) to head (dab17e9).

Files with missing lines Patch % Lines
...iro-ec/src/cairo_ec/circuits/ec_ops_compiled.cairo 30.61% 426 Missing ⚠️
python/cairo-ec/src/cairo_ec/circuits/ec_ops.cairo 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #886      +/-   ##
==========================================
- Coverage   78.10%   77.75%   -0.35%     
==========================================
  Files          63       63              
  Lines       16700    16789      +89     
==========================================
+ Hits        13043    13055      +12     
- Misses       3657     3734      +77     
Flag Coverage Δ
ci 77.75% <30.27%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

assert q_high_shifted_y * q_high_shifted_y = q_high_shifted_x * q_high_shifted_x *
q_high_shifted_x + a * q_high_shifted_x + b;
// Assert q_low is on curve or point at infinity
assert q_low_y * q_low_y = is_on_curve_q_low * (q_low_x * q_low_x * q_low_x + a * q_low_x + b) + (1 - is_on_curve_q_low) * q_low_x;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_on_curve_q_low = 0 => q_low_y**2 == q_low_x but why does this mean that both are 0 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If both are 0 then it's the point at infinity (x=0, y=0)

Copy link
Contributor Author

@zmalatrax zmalatrax Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_on_curve should be refactored as is_point_at_infinity, more accurate on what is expected/done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing a test for ec_mul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants