-
Notifications
You must be signed in to change notification settings - Fork 52
fix(stm): Fix the implementation difference for schnorr signature between cpu and circuit #2994
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
base: main
Are you sure you want to change the base?
Conversation
…chnorr and updated the tests
hjeljeli32
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damrobi
Thanks a lot for the quick turnaround on this PR 🙏
This looks really good to me and is fully aligned with the decisions we discussed yesterday.
I left a couple of small comments regarding doc comments that are now slightly outdated, but nothing blocking from my side.
Great work 👍
| @@ -63,18 +62,10 @@ impl ProjectivePoint { | |||
| /// Hashes input bytes to a projective point on the Jubjub curve | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damrobi
The doc comment on hash_to_projective_point is now outdated.
| /// and works with the Jubjub elliptic curve and the Poseidon hash function. | ||
| /// | ||
| /// Input: | ||
| /// - a message: some bytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damrobi The doc comment needs to be updated.
| /// | ||
| /// Input: | ||
| /// - a Unique Schnorr signature | ||
| /// - a message: some bytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damrobi doc comment needs to be updated
Content
This PR includes a fix to the implementation of the unique schnorr signature that differs between cpu and circuit. This fix mainly consists in modifying the input to the
signandverifyfunctions of theunique_schnorr_signaturemodule to takeBaseFieldElements instead of arbitrary bytes. The bytes that were previously handled within the sign function will be treated outside of the signature in a later PR.Warning: This PR does not include the proper handling of the message bytes and merkle root before giving them to the signature function!
Content of the PR:
hash_to_projective_pointto haveBaseFieldElementas inputssignandverifyfunctions to take&[BaseFieldElement]instead of&[u8]BaseFieldElementto the benchesFrom<&[u8;32]>implementation toBaseFieldElementfor testing onlyPre-submit checklist
Comments
Issue(s)
Relates to #2993