Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Precompile: 0x02 SHA2-256 #319

Open
ChihChengLiang opened this issue Nov 23, 2022 · 3 comments
Open

Precompile: 0x02 SHA2-256 #319

ChihChengLiang opened this issue Nov 23, 2022 · 3 comments

Comments

@ChihChengLiang
Copy link
Collaborator

ChihChengLiang commented Nov 23, 2022

Possible strategy: leveraging the Halo2 existing one.

@ed255
Copy link
Member

ed255 commented Nov 23, 2022

There's a sha256 circuit implementation in the halo2 repository (from zcash) which we should probably use for this precompile: https://github.com/privacy-scaling-explorations/halo2/blob/main/halo2_gadgets/src/sha256.rs

@CPerezz
Copy link
Member

CPerezz commented Nov 23, 2022

Agree! Let's make sure anyway that the sponge config parameters are indeed the same ones as we do need and this kind of stuff!

@Brechtpd
Copy link
Collaborator

Will plug my implementation as a possible candidate as well: privacy-scaling-explorations/zkevm-circuits#756

Should be significantly faster than the halo2 implementation and I think the implementation is also simpler (more straightforward implementation on bits), however at the cost of needing more columns (~130) (though I'm not sure how the implementations compare based on total cells required/hash). One other nice benefit is that my implementation already uses the same lookup API for passing data around as keccak (RLC encoded input and hash) which might be useful.

@ed255 ed255 moved this to 🆕 Product Backlog Items in zkEVM Community Edition Nov 24, 2022
@KimiWu123 KimiWu123 moved this from 🆕 Product Backlog Items to Milestone Tasks in zkEVM Community Edition Oct 25, 2023
@KimiWu123 KimiWu123 added this to the Feature Completeness milestone Oct 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Milestone Tasks
Development

No branches or pull requests

5 participants