-
Notifications
You must be signed in to change notification settings - Fork 182
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
bug: possibly incorrect DST_prime
in ExpandMsgXmd
#477
Comments
Indeed, I also encountered it some time ago. I'd have to recheck, but imo it was due to different versions of the RFC we implemented hash-to-field from. |
I figured out while rewriting this in a gnark circuit... Do you want me to open a PR or we consider this to be fine (maybe backward compatibility would be hurt here)? |
So, we have referenced version 06 in the code, but actually implemented the final version, see: https://datatracker.ietf.org/doc/html/rfc9380. |
Indeed, it would already hurt backwards compatibility as we also implement hash-to-field in the Solidity smart contract verifier and the current PLONK version we have is audited, so cannot modify easily anymore. |
Ah the implementation is correct then, let me just change the reference in case anyone hit this again haha. Thanks for the quick answer! |
It would be perfect! |
Unless I am missing something, it look like instead of
DST_prime = I2OSP(len(DST), 1) ∥ DST
, we doDST_prime = DST || I2OSP(len(DST), 1)
in:gnark-crypto/field/hash/hashutils.go
Lines 37 to 40 in eb75782
gnark-crypto/field/hash/hashutils.go
Lines 53 to 56 in eb75782
gnark-crypto/field/hash/hashutils.go
Lines 77 to 80 in eb75782
The text was updated successfully, but these errors were encountered: