Skip to content

feat!: make schnorr use poseidon#17

Open
kashbrti wants to merge 2 commits intomasterfrom
kb/poseidon_schnorr
Open

feat!: make schnorr use poseidon#17
kashbrti wants to merge 2 commits intomasterfrom
kb/poseidon_schnorr

Conversation

@kashbrti
Copy link
Copy Markdown
Contributor

@kashbrti kashbrti commented Apr 7, 2026

Description

This PR changes Schnorr library to use Poseidon hash instead of pederson + blake.
This is a breaking change and any code using this library has to be updated.

Problem*

Resolves

Summary*

Additional Context

I'm unsure about whether we would need to range constraint the sig_e in assert_valid_signature. I have convinced myself that this can not be an issue, since calculate_signature_challenges calculates e with a poseidon hash and if the sig_e byte value is wrapping, it wouldn't match.
More concretely the sig_e and e should match both modulo BN254_Fq and BN254_Fr (one in the msm the other in the validity check).

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@kashbrti kashbrti requested a review from TomAFrench April 7, 2026 07:26
@kashbrti
Copy link
Copy Markdown
Contributor Author

kashbrti commented Apr 7, 2026

@TomAFrench I added an explanation in the context so you could double-check.

@ledwards2225
Copy link
Copy Markdown

@kashbrti and I discussed the issue about range constraints and concluded that things are fine as-is. sig_e is range constrained to be < BN254 Fr modulus as an integer by virtue of passing through cycle_group::batch_mul via multi_scalar_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

Development

Successfully merging this pull request may close these issues.

2 participants