1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00
ZoKrates/zokrates_cli/examples/book/rng_tutorial/test.sh
2021-12-10 12:38:44 +01:00

36 lines
No EOL
771 B
Bash
Executable file

#!/bin/bash
set -e
bin=$1; stdlib=$2
function zokrates() {
ZOKRATES_STDLIB=$stdlib $bin "$@"
}
zokrates compile -i get_hash.zok -o get_hash && zokrates inspect -i get_hash
zokrates compute-witness --verbose -i get_hash -a 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
mkdir alice bob
cp reveal_bit.zok bob/reveal_bit.zok
cp reveal_bit.zok alice/reveal_bit.zok
cd bob
zokrates compile -i reveal_bit.zok -o reveal_bit
zokrates setup -i reveal_bit
cd ..
cp bob/proving.key alice/proving.key
cd alice
zokrates compile -i reveal_bit.zok -o reveal_bit
zokrates compute-witness --verbose -i reveal_bit -a 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 510
zokrates generate-proof -i reveal_bit
cd ..
cp alice/proof.json bob/proof.json
cd bob
zokrates verify
zokrates export-verifier