zk-email-verify icon indicating copy to clipboard operation
zk-email-verify copied to clipboard

Replace if/loop conditions dependency on input signals with ternary operator.

Open olomix opened this issue 1 year ago • 1 comments

For compatibility with github.com/iden3/circom-witnesscalc.

Description

For now, circom-witnesscalc does not support input signals in the branch and loop conditions. I have replaced few such conditions with ternary operator that is supported by circom-witnesscalc. Now the witness for circuit https://github.com/zk-passport/openpassport/blob/main/circuits/circuits/register/register_rsa_65537_sha256.circom can be calculated using iden3/circom-witnesscalc.

The demo for this witness generation can be found in https://github.com/olomix/witnesscalc-tests repository. All commands required to install dependencies, generate witness and then validate it are specified in the ./run.sh script. It can be run from the repository directory and all dependencies would be installed locally inside this directory. Repository can be safely deleted afterward without any trash in the system. Everything script installs and generates are documented inside comments of this script.

olomix avatar Sep 07 '24 19:09 olomix

Apparently removing the optimization in long div might be changing constraints, we should get the constraint count with and without these changes, and see how significant the difference is.

Divide-By-0 avatar Sep 20 '24 18:09 Divide-By-0