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 secp256r1 support #1351

Merged
merged 72 commits into from
Oct 30, 2024
Merged

feat: add secp256r1 support #1351

merged 72 commits into from
Oct 30, 2024

Conversation

DreamWuGit
Copy link
Member

@DreamWuGit DreamWuGit commented Jun 27, 2024

Description

This PR aims to support secp256r1(p256) precompile from circuit side, below are works on signature circuit side, not include evm circuit(buss mapping), l2geth_util etc.

  • refactor struct SignData to generic type SignData<Fq, Affine>
  • add p256 event to PrecompileEvents and provide method to get p256 signature data
  • halo2-lib: update secp256r1 field(Fp, Fq) implement ScalarField.
  • assign new p256 signature data into sig table
  • sig circuit: refactor assign_ecdsa to support new secp256r1
  • sig circuit: refactor sign_data_decomposition to support secp256r1
  • sig circuit: refactor assign_sig_verify to support secp256r1
  • halo2-lib: update is_on_curve_or_infinity applicable to secp256r1
  • skip keccak lookup for p256 ?
  • adjust params MAX_NUM_SIG, LOOKUP_CELLS_PER_SIG, CELLS_PER_SIG ?
  • testing
    • p256 signature circuit unit test
    • ci (evm/super circuit) test
    • integration test

Issue Link

[link issue here]

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@lispc
Copy link

lispc commented Oct 28, 2024

general seems good.

  1. need to fix ccc
  2. there are many commented codes and println. need to clean
  3. there are some TODOs, need to make final deicisions on them

@DreamWuGit
Copy link
Member Author

DreamWuGit commented Oct 30, 2024

general seems good.

  1. need to fix ccc
  2. there are many commented codes and println. need to clean
  3. there are some TODOs, need to make final deicisions on them

done !

@lispc
Copy link

lispc commented Oct 30, 2024

@roynalnaruto would you have some time to do a quick review on this?

@lispc lispc merged commit 28a8eb5 into develop Oct 30, 2024
17 checks passed
@lispc lispc deleted the feat/secp256r1 branch October 30, 2024 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants