gnark
gnark copied to clipboard
feat: SHA2 partial precompile
Description
This PR adds dedicated precompile circuit for SHA256 permutation on 16-bit limbs (as provided by zkEVM). Keeping in draft until final interface is determined.
Related #466 and #576
Type of change
- [x] New feature (non-breaking change which adds functionality)
How has this been tested?
- [x] TestSHA256Permutation for fixed inputs
How has this been benchmarked?
Checklist:
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] I did not modify files generated from templates
- [x]
golangci-lintdoes not output errors locally - [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules
cc @Tabaie - a mental note to myself, that maybe I can reuse some utility functions from compression circuits for changing the endianness of the inputs.
Closing this PR. Linea prover calls the SHA2 permutation itself now and this wrapper is not needed.