Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

olomix
Copy link

@olomix olomix commented Sep 7, 2024

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.

…perator. For compatibility with iden3/circom-witnesscalc.
@Divide-By-0
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants