-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: vk_as_fields, proof_as_fields flows for honk (#6406)
Closes AztecProtocol/barretenberg#982. Adds the vk_as_fields and proof_as_fields flows for Honk that are used to generate the Vkey and proof as inputs for a recursive circuit (like double_verify_proof). I revamped the script, gen_inner_proof_inputs.sh, that call these flows. I add new serialization/deserialization for ultra/goblin_ultra flavor verification keys which are used in the vk_as_fields flow. Notes: I removed the key_hash output that was part of Plonk's vk_as_fields output since we don't need it.
- Loading branch information
1 parent
6417cd9
commit a6100ad
Showing
13 changed files
with
384 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
barretenberg/acir_tests/gen_inner_proof_inputs_ultra_honk.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
# Env var overrides: | ||
# BIN: to specify a different binary to test with (e.g. bb.js or bb.js-dev). | ||
set -eu | ||
|
||
BIN=${BIN:-../cpp/build/bin/bb} | ||
CRS_PATH=~/.bb-crs | ||
BRANCH=master | ||
VERBOSE=${VERBOSE:-} | ||
RECURSIVE=true | ||
PROOF_NAME="proof_a" | ||
|
||
if [ -f $BIN ]; then | ||
BIN=$(realpath $BIN) | ||
else | ||
BIN=$(realpath $(which $BIN)) | ||
fi | ||
|
||
export BRANCH | ||
|
||
./clone_test_vectors.sh | ||
|
||
cd acir_tests/assert_statement_recursive | ||
|
||
PROOF_DIR=$PWD/proofs | ||
PROOF_PATH=$PROOF_DIR/$PROOF_NAME | ||
VFLAG=${VERBOSE:+-v} | ||
RFLAG=${RECURSIVE:+-r} | ||
|
||
echo "Write VK to file for assert_statement..." | ||
$BIN write_vk_ultra_honk $VFLAG -c $CRS_PATH -o ./target/vk | ||
|
||
echo "Write VK as fields for recursion..." | ||
$BIN vk_as_fields_ultra_honk $VFLAG -c $CRS_PATH -k ./target/vk -o ./target/vk_fields.json | ||
|
||
echo "Generate proof to file..." | ||
[ -d "$PROOF_DIR" ] || mkdir $PWD/proofs | ||
[ -e "$PROOF_PATH" ] || touch $PROOF_PATH | ||
$BIN prove_ultra_honk $VFLAG -c $CRS_PATH -b ./target/program.json -o "./proofs/$PROOF_NAME" | ||
|
||
echo "Write proof as fields for recursion..." | ||
$BIN proof_as_fields_honk $VFLAG -c $CRS_PATH -p "./proofs/$PROOF_NAME" -o "./proofs/${PROOF_NAME}_fields.json" | ||
|
||
cat ./proofs/${PROOF_NAME}_fields.json | ||
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.