Replace if/loop conditions dependency on input signals with ternary operator. #217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 bycircom-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 usingiden3/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.