Skip to content

Commit ed2f720

Browse files
committed
fix hasher
1 parent db641e7 commit ed2f720

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

packages/contracts/noir/run.sh

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ CIRCUIT=target/$CIRCUIT_NAME.json
1212

1313
# merge Prover1.toml and Prover2.toml into Prover.toml
1414
# Convert TOML to JSON
15-
dasel -f "$CIRCUIT_NAME/Prover1.toml" -r toml -w json > prover1.json
16-
dasel -f "$CIRCUIT_NAME/Prover2.toml" -r toml -w json > prover2.json
15+
dasel -f "$CIRCUIT_NAME/Prover1.toml" -r toml -w json >prover1.json
16+
dasel -f "$CIRCUIT_NAME/Prover2.toml" -r toml -w json >prover2.json
1717
# Merge JSON with jq
18-
jq -s '.[0] * .[1]' prover1.json prover2.json > merged.json
18+
jq -s '.[0] * .[1]' prover1.json prover2.json >merged.json
1919
# Convert back to TOML
20-
dasel -f merged.json -r json -w toml > "$CIRCUIT_NAME/Prover.toml"
20+
dasel -f merged.json -r json -w toml >"$CIRCUIT_NAME/Prover.toml"
2121
rm prover1.json prover2.json merged.json
2222

2323
# split input into shares
@@ -49,9 +49,9 @@ wait $(jobs -p)
4949
timeEnd "mpc-build-proving-key"
5050

5151
timeStart "mpc-generate-proof"
52-
co-noir generate-proof --proving-key target/proving_key.0 --protocol REP3 --hasher KECCAK --crs ~/.bb-crs/bn254_g1.dat --config configs/party0.toml --out target/proof.0.proof --public-input target/public_input.json &
53-
co-noir generate-proof --proving-key target/proving_key.1 --protocol REP3 --hasher KECCAK --crs ~/.bb-crs/bn254_g1.dat --config configs/party1.toml --out target/proof.1.proof &
54-
co-noir generate-proof --proving-key target/proving_key.2 --protocol REP3 --hasher KECCAK --crs ~/.bb-crs/bn254_g1.dat --config configs/party2.toml --out target/proof.2.proof
52+
co-noir generate-proof --proving-key target/proving_key.0 --protocol REP3 --hasher keccak --crs ~/.bb-crs/bn254_g1.dat --config configs/party0.toml --out target/proof.0.proof --public-input target/public_input.json &
53+
co-noir generate-proof --proving-key target/proving_key.1 --protocol REP3 --hasher keccak --crs ~/.bb-crs/bn254_g1.dat --config configs/party1.toml --out target/proof.1.proof &
54+
co-noir generate-proof --proving-key target/proving_key.2 --protocol REP3 --hasher keccak --crs ~/.bb-crs/bn254_g1.dat --config configs/party2.toml --out target/proof.2.proof
5555
wait $(jobs -p)
5656
timeEnd "mpc-generate-proof"
5757

@@ -62,13 +62,12 @@ timeStart "bb-generate-proof"
6262
bb prove_ultra_keccak_honk -b $CIRCUIT -w target/$CIRCUIT_NAME.gz -o target/proof_bb.proof
6363
timeEnd "bb-generate-proof"
6464

65-
6665
# Create verification key
67-
co-noir create-vk --circuit $CIRCUIT --crs bn254_g1.dat --hasher KECCAK --vk target/verification_key
66+
co-noir create-vk --circuit $CIRCUIT --crs bn254_g1.dat --hasher keccak --vk target/verification_key
6867
echo "Verification key created"
6968

7069
# verify proof
71-
co-noir verify --proof target/proof.0.proof --vk target/verification_key --hasher KECCAK --crs bn254_g2.dat
70+
co-noir verify --proof target/proof.0.proof --vk target/verification_key --hasher keccak --crs bn254_g2.dat
7271
echo "Proof verified"
7372

7473
bb write_vk_ultra_keccak_honk -b $CIRCUIT -o target/verification_key_bb

packages/contracts/sdk/mpc/run-party.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ co-noir build-proving-key --witness $WORK_DIR/witness.gz.$PARTY_INDEX.shared --c
3333
timeEnd "mpc-build-proving-key"
3434

3535
timeStart "mpc-generate-proof"
36-
co-noir generate-proof --proving-key $WORK_DIR/proving_key.$PARTY_INDEX --protocol REP3 --hasher KECCAK --crs ~/.bb-crs/bn254_g1.dat --config $PARTY_CONFIGS_DIR/party$PARTY_INDEX.toml --out $WORK_DIR/proof.$PARTY_INDEX.proof --public-input $WORK_DIR/public_input.json
36+
co-noir generate-proof --proving-key $WORK_DIR/proving_key.$PARTY_INDEX --protocol REP3 --hasher keccak --crs ~/.bb-crs/bn254_g1.dat --config $PARTY_CONFIGS_DIR/party$PARTY_INDEX.toml --out $WORK_DIR/proof.$PARTY_INDEX.proof --public-input $WORK_DIR/public_input.json
3737
timeEnd "mpc-generate-proof"

0 commit comments

Comments
 (0)