gnark icon indicating copy to clipboard operation
gnark copied to clipboard

feat: SHA2 partial precompile

Open ivokub opened this issue 1 year ago • 1 comments

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-lint does 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

ivokub avatar Apr 22 '24 13:04 ivokub

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.

ivokub avatar Apr 22 '24 13:04 ivokub

Closing this PR. Linea prover calls the SHA2 permutation itself now and this wrapper is not needed.

ivokub avatar Jul 18 '24 20:07 ivokub