filecoin-project / bellperson

zk-SNARK library
Other
190 stars 120 forks source link

Make sha256_compression_function a public method? #301

Closed avras closed 1 year ago

avras commented 1 year ago

Would it be possible to expose the sha256_compression_function in src/gadgets/sha256.rs as a public method?

Motivation: A SHA256 hash can be expressed as a repeated application of its compression function. It is a good fit for Nova. I have an implementation here https://github.com/avras/nova-sha256. It uses a copy of bellperson's sha256 gadget with the sha256_compression_function as a public method. It would be nice to get rid of this redundancy.

Would anyone else care?: Celer Network recently released SHA256 circuit benchmarks. https://twitter.com/CelerNetwork/status/1631143849300213760 The peak memory usage of the prover was in the range of 2 GB to 100 GB for all the frameworks they considered. The Nova-based prover requires only 190MB and runs in under 3 minutes on a 11th Gen i5 CPU. I think this would make Nova suitable for client-side SHA256 proof generation.

image

vmx commented 1 year ago

I'm sorry, I totally forgot about this issue. To me it sounds OK making it public.

@cryptonemo any objections?

cryptonemo commented 1 year ago

I'm sorry, I totally forgot about this issue. To me it sounds OK making it public.

@cryptonemo any objections?

None!