Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Conversation

@roynalnaruto
Copy link

@roynalnaruto roynalnaruto commented Oct 11, 2023

Description

ECDSA function would have panicked for edge cases. This PR implements the ec_add_unequal for u1_mul + u2_mul in a non-panicking way, and handles cases such as u1_is_zero and u2_is_zero by the Selectable trait.

Instead of using the random point approach, we compute u1_mul + u2_mul taking into account edge cases such as:

  • u1_is_zero
  • u2_is_zero
  • sum_is_infinity

We effectively do not need the random point (tmp) approach, and have the EC Point sum, i.e. (x_3, y_3) by making minor changes to the divide_unsafe logic and using Selectable trait to select appropriate values for x_3 and y_3.

@roynalnaruto roynalnaruto changed the title fix: ec_sub_unequal would have panicked for some edge cases ec_sub_unequal would have panicked for some edge cases Oct 11, 2023
Copy link

@zhenfeizhang zhenfeizhang left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for handling this...

@zhenfeizhang zhenfeizhang merged commit 518de73 into fix/tob-wave3-review Oct 11, 2023
@zhenfeizhang zhenfeizhang deleted the fix/tob-wave3-review-ecdsa-panic branch October 11, 2023 21:57
lispc pushed a commit that referenced this pull request Oct 25, 2023
* fix soundness bug in ecdsa circuit

* update parameters

* fix: ec_sub_unequal would have panicked for some edge cases (#999)

* update ecdsa parameters

---------

Co-authored-by: Rohit Narurkar <rohit.narurkar@protonmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants