From 9c71a2cbf5884fa606ee6bce05af8cc5ad31d23d Mon Sep 17 00:00:00 2001 From: Oleg Lomaka Date: Wed, 15 Nov 2023 03:40:28 -0500 Subject: [PATCH] Fix getting random entropy on macOS (#114) --- compile-circuit.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compile-circuit.sh b/compile-circuit.sh index 38c1ecf4..cf8fd992 100755 --- a/compile-circuit.sh +++ b/compile-circuit.sh @@ -29,9 +29,9 @@ compile_and_ts() { # time snarkjs setup -r circuit.r1cs --pk proving_key.json --vk verification_key.json time snarkjs groth16 setup circuit.r1cs "$PTAU" circuit_0000.zkey - ENTROPY1=$(head -c 1024 /dev/urandom | LC_CTYPE=C tr -dc 'a-zA-Z0-9' | head -c 128) - ENTROPY2=$(head -c 1024 /dev/urandom | LC_CTYPE=C tr -dc 'a-zA-Z0-9' | head -c 128) - ENTROPY3=$(head -c 1024 /dev/urandom | LC_CTYPE=C tr -dc 'a-zA-Z0-9' | head -c 128) + ENTROPY1=$(head -c 64 /dev/urandom | od -An -tx1 -v | tr -d ' \n') + ENTROPY2=$(head -c 64 /dev/urandom | od -An -tx1 -v | tr -d ' \n') + ENTROPY3=$(head -c 64 /dev/urandom | od -An -tx1 -v | tr -d ' \n') # time snarkjs zkey contribute circuit_0000.zkey circuit_0001.zkey --name="1st Contribution" -v -e="$ENTROPY1" # time snarkjs zkey contribute circuit_0001.zkey circuit_0002.zkey --name="2nd Contribution" -v -e="$ENTROPY2"