-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
2,077 additions
and
417 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
export PROOF="$(pwd)/proof" | ||
export PROOF_AS_FIELDS="$(pwd)/proof_fields.json" | ||
|
||
# Create a proof, write the solidity contract, write the proof as fields in order to extract the public inputs | ||
$BIN prove_keccak_ultra_honk -o proof | ||
$BIN write_vk_ultra_honk -o vk | ||
$BIN proof_as_fields_honk -k vk -c $CRS_PATH -p $PROOF | ||
$BIN contract_ultra_honk -k vk -c $CRS_PATH -b ./target/program.json -o Verifier.sol | ||
|
||
# Export the paths to the environment variables for the js test runner | ||
export VERIFIER_PATH="$(pwd)/Verifier.sol" | ||
export TEST_PATH=$(realpath "../../sol-test/HonkTest.sol") | ||
export TESTING_HONK="true" | ||
|
||
# Use solcjs to compile the generated key contract with the template verifier and test contract | ||
# index.js will start an anvil, on a random port | ||
# Deploy the verifier then send a test transaction | ||
export TEST_NAME=$(basename $(pwd)) | ||
node ../../sol-test/src/index.js |
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,18 @@ | ||
// THIS FILE WILL NOT COMPILE BY ITSELF | ||
// Compilation is handled in `src/index.js` where solcjs gathers the dependencies | ||
|
||
pragma solidity >=0.8.4; | ||
|
||
import {HonkVerifier} from "./Verifier.sol"; | ||
|
||
contract Test { | ||
HonkVerifier verifier; | ||
|
||
constructor() { | ||
verifier = new HonkVerifier(); | ||
} | ||
|
||
function test(bytes calldata proof, bytes32[] calldata publicInputs) view public returns(bool) { | ||
return verifier.verify(proof, publicInputs); | ||
} | ||
} |
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.