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

Add Poseidon31 hasher #971

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

weikengchen
Copy link
Contributor

@weikengchen weikengchen commented Jan 9, 2025

This PR adds the Poseidon31 hasher, which is useful for recursive proof verification of a M31 proof over the M31 field.
Benchmark for proof generation suggests that the proof time is doubled when using Poseidon31 instead of Blake2s.

The Poseidon31 implementation resembles the one for Poseidon252, in that we do not use Poseidon sponge, but shapes it as a cryptographically secure hash function for compression and derivation.

@reviewable-StarkWare
Copy link

This change is Reviewable

@weikengchen
Copy link
Contributor Author

A potential issue with this PR is that the PR is from an organization (Bitcoin-Wildlife-Sanctuary) instead of a personal account. If it would be easy for me to resubmit this PR from a personal account (and allow edits from maintainers), please let me know and I can close this PR and open a new one.

@weikengchen
Copy link
Contributor Author

This is the accompanying Sage script for the parameters:
https://gist.github.com/weikengchen/3257577d4a013f49cb59507d8100fb6a

and can be cross-checked in SageCell https://sagecell.sagemath.org/

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