-
Notifications
You must be signed in to change notification settings - Fork 0
/
native_honk.sh
executable file
·32 lines (29 loc) · 1.05 KB
/
native_honk.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
cd circuit
## Set the date utility depending on OSX or Linix
if command -v gdate &> /dev/null
then
# Set variable for gdate
date_cmd='gdate'
else
# Set variable for date (Linux typically)
date_cmd='date'
fi
echo "Calculating witness..."
start_time=$($date_cmd +%s%N)
## Calculate the witness of the circuit
nargo execute witness &> /dev/null
witness_end=$($date_cmd +%s%N)
duration_witness=$((witness_end - start_time))
witness_seconds=$(echo "$duration_witness / 1000000000" | bc -l)
echo "Witness generated in: $witness_seconds seconds"
echo "Proving with UltraHonk..."
## Generate the proof
bb prove_ultra_honk -b ./target/noir_zkemail_benchmarks.json -w ./target/witness.gz -o ./target/honk.proof
end_time=$($date_cmd +%s%N)
duration_prover=$((end_time - witness_end))
duration_total=$((end_time - start_time))
prover_seconds=$(echo "$duration_prover / 1000000000" | bc -l)
total_seconds=$(echo "$duration_total / 1000000000" | bc -l)
echo "Proof generated in: $prover_seconds seconds"
echo "Total time for client: $total_seconds seconds"