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

feat: add ripemd160 hash function with permutation #1120

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ivokub
Copy link
Collaborator

@ivokub ivokub commented Apr 29, 2024

Description

This PR adds the permutation function used in ripemd160 and the full hash function. Hash function construction is similar to SHA2, except uses little endian encoding.

Implementing as a precompile for Linea will be done in a separate PR when the interfaces are fixed.

Type of change

  • New feature (non-breaking change which adds functionality)

How has this been tested?

  • TestBlockGeneric for testing permutation function
  • TestRipemd160 for testing as hash function

How has this been benchmarked?

In SCS a block cost is approx 60k PLONKish constraints. Not very specific as there is overhead for initializing the lookup table for AND/XOR/OR computation.

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@ivokub ivokub added new feature zk-evm P1: High Issue priority: high labels Apr 29, 2024
@ivokub ivokub requested a review from Tabaie April 29, 2024 11:55
@ivokub ivokub self-assigned this Apr 29, 2024
@ivokub ivokub requested a review from gbotrel July 18, 2024 17:09
@ivokub
Copy link
Collaborator Author

ivokub commented Jul 18, 2024

@Tabaie, @gbotrel - ready for review.

@ivokub
Copy link
Collaborator Author

ivokub commented Nov 22, 2024

@Tabaie - I added additionally false positive ignores for the statticcheck. Our linters have become more strict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants