hermeznetwork / circuits

Implements hermez network zk-Snarks circuits
GNU Affero General Public License v3.0
55 stars 21 forks source link

Sha256 parallelization #1

Open krlosMata opened 3 years ago

krlosMata commented 3 years ago

Overview

Sha256 circom component does not parallelize at the time to compute the witness. The other rollup-main components (DecodeTx, RollupTx & FeeTx) are already parallelized, being the Sha256 component the one which takes mucht ime to be calculated. There are two approaches that could be followed when trying to paralleize Sha256:

1 - External intermediary signals

This approach pretends to calculate Sha256 internal blocks outside of the circuit. Therefore, intermediary signals should be added to the rollup-main circuit. Besides, circomlib Sha256 should be adapted to accept those intermediary signalsa nd check them properly.

2 - Internal intermediary signals

This approach computes Sha256 internal blocks directly on the circom Sha256 circomlib circuit. No additional signals should be added to the rollup-main circuit but a new Sha256Parallel should be build on circomlib.