-
Notifications
You must be signed in to change notification settings - Fork 16
Sha256 parallelization #1
Description
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.
- Following this approach:
- small changes on circomlib
Sha256 - small changes on
rollup-maincircuit - Javascript and Go implementation to get Sha256 intermediary signals
- it will reduce witness time computation
- small changes on circomlib
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.
- Following this approach:
- new circomlib
Sha256Parallelcircuit implementing block computation with no comnstraints - no changes on
rollup-maincircuit (just changing the template name) - general circomlib implementation to be used for anyone an not for an specific circuit
- should be benchmarrking if this approach really redice the witness computation
- new circomlib