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

error when execute "cat zokrates_inputs.txt | ./zokrates compute-witness" #14

Open
qin068 opened this issue Apr 22, 2021 · 1 comment
Open

Comments

@qin068
Copy link

qin068 commented Apr 22, 2021

When execute this command,error message appears "Program takes 21 inputs but was passed 0 values",if I use the command "./zokrates compute-witness -a xxx", where xxx means the content in zokrates_inputs, error message appears Program takes 21 inputs but was passed 517 values. I guess that it's a matter of parameters,mybe caused by version upgrade, what can I do to fix this problem?

@tanmay-j1
Copy link

tanmay-j1 commented Dec 9, 2021

This command works for me to supply arguments from the file to the command. zokrates compute-witness -a $(cat zokrates_inputs.txt). Now the problem reduces to having an incorrect number of arguments.

There might be an issue with the pip installation. I faced the same issue. Upon inspection of the code, I realized the code should be functional. I copied the function "write_signature_for_zokrates_cli" from zokrates_pycrypto/utils.py and pasted the function in demo.py and used that while following the readme, and it was able to generate witness.

The real problem happens because the zokrates script accepts 21 inputs (5 + 16 32-bit ints) whereas the version of the library installed with pip provides (5 + 512 1-bit ints) in the zokrates_inputs.txt file. Manually pasting the function in your python code can serve as a temporary fix.

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

No branches or pull requests

2 participants