diff --git a/circuit-lib/circuit-lib.circom/package.json b/circuit-lib/circuit-lib.circom/package.json index a4e23f053f..000805ed92 100644 --- a/circuit-lib/circuit-lib.circom/package.json +++ b/circuit-lib/circuit-lib.circom/package.json @@ -4,7 +4,7 @@ "description": "", "license": "GPL-3.0", "scripts": { - "build-merkle": "./scripts/buildMerkle.sh" + "build-circuits": "./scripts/buildCircuits.sh" }, "author": "", "devDependencies": { diff --git a/circuit-lib/circuit-lib.circom/scripts/buildCombinedMerkleCircuits.sh b/circuit-lib/circuit-lib.circom/scripts/buildCircuits.sh similarity index 100% rename from circuit-lib/circuit-lib.circom/scripts/buildCombinedMerkleCircuits.sh rename to circuit-lib/circuit-lib.circom/scripts/buildCircuits.sh diff --git a/circuit-lib/circuit-lib.circom/scripts/buildMerkle.sh b/circuit-lib/circuit-lib.circom/scripts/buildMerkle.sh deleted file mode 100755 index d35a8388e9..0000000000 --- a/circuit-lib/circuit-lib.circom/scripts/buildMerkle.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -e - -function download_ptau { - directory="$1" - ptau_number="$2" - - if [ ! -f "$directory/ptau$ptau_number" ]; then - echo "Downloading powers of tau file" - curl -L "https://hermez.s3-eu-west-1.amazonaws.com/powersOfTau28_hez_final_$ptau_number.ptau" --create-dirs -o "$directory/ptau$ptau_number" || { echo "Download failed"; exit 1; } - fi -} - -function execute_commands { - echo "Building merkle tree with height $1 and $2 UTXOs..." - - merkle_number="$1" - utxo_count="$2" - ptau_number="$3" - - if [[ $# -ne 3 ]]; then - echo "Invalid number of arguments" - exit 1; - fi - - temp_directory="/tmp" - - build_directory="$CIRCUIT_RS_DIR/test-data/merkle${merkle_number}_$utxo_count" - src_directory="$CIRCUIT_RS_VERIFYINGKEY_DIR/merkle${merkle_number}_$utxo_count" - circuits_circom_directory="$REPO_TOP_DIR/circuit-lib/circuit-lib.circom" - mkdir -p "$build_directory" - mkdir -p "$src_directory" - download_ptau "$temp_directory" "$ptau_number" || { echo "download_ptau failed"; exit 1; } - echo "Compiling circuits..." - circom --r1cs --wasm --sym "$circuits_circom_directory/src/merkle-tree/merkle${merkle_number}_$utxo_count.circom" \ - -o "$temp_directory" -l "$circuits_circom_directory/node_modules/circomlib/circuits" || { echo "circom failed"; exit 1; } - - echo "Generating keys..." - npx snarkjs groth16 setup "$temp_directory/merkle${merkle_number}_$utxo_count.r1cs" "$temp_directory/ptau$ptau_number" "$temp_directory/tmp_circuit.zkey" \ - || { echo "snarkjs groth16 setup failed"; exit 1; } - - echo "Contributing to powers of tau..." - npx snarkjs zkey contribute "$temp_directory/tmp_circuit.zkey" "$temp_directory/circuit.zkey" -e="321432151325321543215" \ - || { echo "snarkjs zkey contribute failed"; exit 1; } - rm "$temp_directory/tmp_circuit.zkey" - - echo "Verifying proof..." - npx snarkjs zkey verify "$temp_directory/merkle${merkle_number}_$utxo_count.r1cs" "$temp_directory/ptau$ptau_number" "$temp_directory/circuit.zkey" || { echo "snarkjs zkey verify failed"; exit 1; } - - echo "Exporting verification key..." - npx snarkjs zkey export verificationkey "$temp_directory/circuit.zkey" "$temp_directory/merkle${merkle_number}_$utxo_count.json" - - cp "$temp_directory/circuit.zkey" "$build_directory/circuit.zkey" - cp "$temp_directory/merkle${merkle_number}_${utxo_count}_js/merkle${merkle_number}_${utxo_count}.wasm" "$build_directory/circuit.wasm" - - - echo "Parsing verification key to Rust..." - npx ts-node "$circuits_circom_directory/scripts/parseVerifyingKeyToRust.js" "$temp_directory/merkle${merkle_number}_$utxo_count.json" "$src_directory" - echo "mod merkle${merkle_number}_$utxo_count;" >> "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs"; - echo "pub use crate::verifying_keys::merkle${merkle_number}_$utxo_count::VERIFYINGKEY as VK${merkle_number}_$utxo_count;" >> "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs"; - - echo "Done" -} - -REPO_TOP_DIR=$(git rev-parse --show-toplevel) - -CIRCUIT_RS_DIR="$REPO_TOP_DIR/circuit-lib/circuitlib-rs" -CIRCUIT_RS_VERIFYINGKEY_DIR="$CIRCUIT_RS_DIR/src/verifying_keys" - -rm "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs" -touch "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs" -echo "mod helpers;" >> "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs"; -echo "pub use crate::verifying_keys::helpers::vk;" >> "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs"; - -POWERS_OF_TAU=16 -MAX_COUNT=4 - -MERKLE_TREE_HEIGHT=26 -for ((i=1; i<=MAX_COUNT; i++)); do - execute_commands "$MERKLE_TREE_HEIGHT" "$i" "$POWERS_OF_TAU" || exit -done - -execute_commands "$MERKLE_TREE_HEIGHT" 8 "$POWERS_OF_TAU" || exit diff --git a/circuit-lib/circuit-lib.circom/scripts/buildNonInclusion.sh b/circuit-lib/circuit-lib.circom/scripts/buildNonInclusion.sh deleted file mode 100755 index 2b6bce0778..0000000000 --- a/circuit-lib/circuit-lib.circom/scripts/buildNonInclusion.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -e - -function download_ptau { - directory="$1" - ptau_number="$2" - - if [ ! -f "$directory/ptau$ptau_number" ]; then - echo "Downloading powers of tau file" - curl -L "https://hermez.s3-eu-west-1.amazonaws.com/powersOfTau28_hez_final_$ptau_number.ptau" --create-dirs -o "$directory/ptau$ptau_number" || { echo "Download failed"; exit 1; } - fi -} - -function execute_commands { - echo "Building non-inclusion merkle tree with height $1 and $2 UTXOs..." - - merkle_number="$1" - utxo_count="$2" - ptau_number="$3" - - if [[ $# -ne 3 ]]; then - echo "Invalid number of arguments" - exit 1; - fi - - temp_directory="/tmp" - name="ni_${merkle_number}_$utxo_count" - build_directory="$CIRCUIT_RS_DIR/test-data/$name" - src_directory="$CIRCUIT_RS_VERIFYINGKEY_DIR/$name" - circuits_circom_directory="$REPO_TOP_DIR/circuit-lib/circuit-lib.circom" - mkdir -p "$build_directory" - mkdir -p "$src_directory" - - download_ptau "$temp_directory" "$ptau_number" || { echo "download_ptau failed"; exit 1; } - echo "Compiling circuits..." - circom --r1cs --wasm --sym "$circuits_circom_directory/src/non-inclusion-merkle-tree/$name.circom" \ - -o "$temp_directory" -l "$circuits_circom_directory/node_modules/circomlib/circuits" || { echo "circom failed"; exit 1; } - - echo "Generating keys..." - npx snarkjs groth16 setup "$temp_directory/$name.r1cs" "$temp_directory/ptau$ptau_number" "$temp_directory/tmp_$name.zkey" \ - || { echo "snarkjs groth16 setup failed"; exit 1; } - - echo "Contributing to powers of tau..." - npx snarkjs zkey contribute "$temp_directory/tmp_$name.zkey" "$temp_directory/$name.zkey" -e="321432151325321543215" \ - || { echo "snarkjs zkey contribute failed"; exit 1; } - rm "$temp_directory/tmp_$name.zkey" - - echo "Verifying proof..." - npx snarkjs zkey verify "$temp_directory/$name.r1cs" "$temp_directory/ptau$ptau_number" "$temp_directory/$name.zkey" || { echo "snarkjs zkey verify failed"; exit 1; } - - echo "Exporting verification key..." - npx snarkjs zkey export verificationkey "$temp_directory/$name.zkey" "$temp_directory/$name.json" - - cp "$temp_directory/$name.zkey" "$build_directory/$name.zkey" - cp "$temp_directory/${name}_js/$name.wasm" "$build_directory/circuit.wasm" - - echo "Parsing verification key to Rust..." - npx ts-node "$circuits_circom_directory/scripts/parseVerifyingKeyToRust.js" "$temp_directory/$name.json" "$src_directory" - echo "mod $name;" >> "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs"; - echo "pub use crate::verifying_keys::$name::VERIFYINGKEY as VK_$name;" >> "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs"; - - echo "Done" -} - -REPO_TOP_DIR=$(git rev-parse --show-toplevel) - -CIRCUIT_RS_DIR="$REPO_TOP_DIR/circuit-lib/circuitlib-rs" -CIRCUIT_RS_VERIFYINGKEY_DIR="$CIRCUIT_RS_DIR/src/verifying_keys" - -rm "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs" -touch "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs" -echo "mod helpers;" >> "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs"; -echo "pub use crate::verifying_keys::helpers::vk;" >> "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs"; - -POWERS_OF_TAU=16 -MAX_COUNT=4 - -MERKLE_TREE_HEIGHT=26 -for ((i=1; i<=MAX_COUNT; i++)); do - execute_commands "$MERKLE_TREE_HEIGHT" "$i" "$POWERS_OF_TAU" || exit -done - -execute_commands "$MERKLE_TREE_HEIGHT" 8 "$POWERS_OF_TAU" || exit diff --git a/circuit-lib/circuit-lib.circom/scripts/buildNonInclusionCircuits.sh b/circuit-lib/circuit-lib.circom/scripts/buildNonInclusionCircuits.sh new file mode 100755 index 0000000000..75111cac08 --- /dev/null +++ b/circuit-lib/circuit-lib.circom/scripts/buildNonInclusionCircuits.sh @@ -0,0 +1,105 @@ +#!/bin/bash -e + +function download_ptau { + directory="$1" + ptau_number="$2" + + if [ ! -f "$directory/ptau$ptau_number" ]; then + echo "Downloading powers of tau file" + curl -L "https://hermez.s3-eu-west-1.amazonaws.com/powersOfTau28_hez_final_$ptau_number.ptau" --create-dirs -o "$directory/ptau$ptau_number" || { echo "Download failed"; exit 1; } + fi +} + +function execute_commands { + if [[ $# -ne 4 ]] && [[ $# -ne 5 ]]; then + echo "Invalid number of arguments" + exit 1; + fi + + type="$1" + merkle_number="$2" + utxo_count="$3" + ptau_number="$4" + combined_non_inclusion_utxo_count="$5" + + + temp_directory="/tmp" + circuits_circom_directory="$REPO_TOP_DIR/circuit-lib/circuit-lib.circom" + + if [ "$type" == "non-inclusion" ]; then + name="ni_${merkle_number}_$utxo_count" + circuit_dir="non-inclusion-merkle-proof" + elif [ "$type" == "inclusion" ]; then + name="i_${merkle_number}_$utxo_count" + circuit_dir="inclusion-merkle-proof" + elif [ "$type" == "combined" ]; then + name="combined_${merkle_number}_${utxo_count}_${combined_non_inclusion_utxo_count}" + circuit_dir="combined-merkle-proof" + + else + echo "Invalid type" + exit 1; + fi + + build_directory="$CIRCUIT_RS_DIR/test-data/$name" + src_directory="$CIRCUIT_RS_VERIFYINGKEY_DIR/$name" + + mkdir -p "$build_directory" + mkdir -p "$src_directory" + + download_ptau "$temp_directory" "$ptau_number" || { echo "download_ptau failed"; exit 1; } + echo "Compiling circuits..." + circom --r1cs --wasm --sym "$circuits_circom_directory/src/$circuit_dir/$name.circom" \ + -o "$temp_directory" -l "$circuits_circom_directory/node_modules/circomlib/circuits" || { echo "circom failed"; exit 1; } + + echo "Generating keys..." + npx snarkjs groth16 setup "$temp_directory/$name.r1cs" "$temp_directory/ptau$ptau_number" "$temp_directory/tmp_$name.zkey" \ + || { echo "snarkjs groth16 setup failed"; exit 1; } + + echo "Contributing to powers of tau..." + npx snarkjs zkey contribute "$temp_directory/tmp_$name.zkey" "$temp_directory/$name.zkey" -e="321432151325321543215" \ + || { echo "snarkjs zkey contribute failed"; exit 1; } + rm "$temp_directory/tmp_$name.zkey" + + echo "Verifying proof..." + npx snarkjs zkey verify "$temp_directory/$name.r1cs" "$temp_directory/ptau$ptau_number" "$temp_directory/$name.zkey" || { echo "snarkjs zkey verify failed"; exit 1; } + + echo "Exporting verification key..." + npx snarkjs zkey export verificationkey "$temp_directory/$name.zkey" "$temp_directory/$name.json" + + cp "$temp_directory/$name.zkey" "$build_directory/$name.zkey" + cp "$temp_directory/${name}_js/$name.wasm" "$build_directory/$name.wasm" + +# echo "Parsing verification key to Rust..." +# npx ts-node "$circuits_circom_directory/scripts/parseVerifyingKeyToRust.js" "$temp_directory/$name.json" "$src_directory" +# echo "mod $name;" >> "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs"; +# echo "pub use crate::verifying_keys::$name::VERIFYINGKEY as VK_$name;" >> "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs"; + + echo "Done" +} + +REPO_TOP_DIR=$(git rev-parse --show-toplevel) + +CIRCUIT_RS_DIR="$REPO_TOP_DIR/circuit-lib/circuitlib-rs" +CIRCUIT_RS_VERIFYINGKEY_DIR="$CIRCUIT_RS_DIR/src/verifying_keys" +# +#rm "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs" +#touch "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs" +#echo "mod helpers;" >> "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs"; +#echo "pub use crate::verifying_keys::helpers::vk;" >> "$CIRCUIT_RS_VERIFYINGKEY_DIR/mod.rs"; + +POWERS_OF_TAU=16 +MERKLE_TREE_HEIGHT=26 +MAX_COUNT=4 + +#for ((i=1; i<=MAX_COUNT; i++)); do +# execute_commands "inclusion" "$MERKLE_TREE_HEIGHT" "$i" "$POWERS_OF_TAU" || exit +#done +# +#execute_commands "inclusion" "$MERKLE_TREE_HEIGHT" 8 "$POWERS_OF_TAU" || exit + +for ((i=1; i<=MAX_COUNT; i++)); do + execute_commands "non-inclusion" "$MERKLE_TREE_HEIGHT" "$i" "$POWERS_OF_TAU" || exit +done + +execute_commands "non-inclusion" "$MERKLE_TREE_HEIGHT" 8 "$POWERS_OF_TAU" || exit \ No newline at end of file diff --git a/circuit-lib/circuit-lib.circom/src/non-inclusion-merkle-proof/NonInclusionMerkleProof.circom b/circuit-lib/circuit-lib.circom/src/non-inclusion-merkle-proof/NonInclusionMerkleProof.circom index f4d0a7ad76..632ecb88fa 100644 --- a/circuit-lib/circuit-lib.circom/src/non-inclusion-merkle-proof/NonInclusionMerkleProof.circom +++ b/circuit-lib/circuit-lib.circom/src/non-inclusion-merkle-proof/NonInclusionMerkleProof.circom @@ -68,6 +68,7 @@ template NonInclusionProof(levels) { signal input indexHashedIndexedElementLeaf; // check that leafLowerRangeValue less than notIncludedValue + log("NonInclusionProof, checking higherThanLower..."); component higherThanLower = LessThan(252); higherThanLower.in[0] <== leafLowerRangeValue; higherThanLower.in[1] <== value; @@ -75,6 +76,7 @@ template NonInclusionProof(levels) { leafLowerRangeValueLessThanNotIncludedValue === 1; // check that notIncludedValue less than leafHigherRangeValue + log("NonInclusionProof, checking lessThanHigher..."); component lessThanHigher = LessThan(252); lessThanHigher.in[0] <== value; lessThanHigher.in[1] <== leafHigherRangeValue; @@ -82,17 +84,20 @@ template NonInclusionProof(levels) { notIncludedValueLessThanLeafHigherRangeValue === 1; // Leaf Calculation + log("NonInclusionProof, calculating leaf..."); component poseidon = Poseidon(3); poseidon.inputs[0] <== leafLowerRangeValue; poseidon.inputs[1] <== leafIndex; poseidon.inputs[2] <== leafHigherRangeValue; signal leaf <== poseidon.out; + log("NonInclusionProof, poseidon(", leafLowerRangeValue, ", ", leafIndex, ", ", leafHigherRangeValue, ") = ", leaf); // Inclusion Proof Attempt component merkleProof = MerkleProof(levels); merkleProof.leaf <== leaf; merkleProof.pathElements <== merkleProofHashedIndexedElementLeaf; merkleProof.pathIndices <== indexHashedIndexedElementLeaf; + log("NonInclusionProof, root = ", root, ", merkleProof.root = ", merkleProof.root); merkleProof.root === root; } \ No newline at end of file diff --git a/circuit-lib/circuit-lib.js/package.json b/circuit-lib/circuit-lib.js/package.json index b07964dcf3..969e7a24c2 100644 --- a/circuit-lib/circuit-lib.js/package.json +++ b/circuit-lib/circuit-lib.js/package.json @@ -6,6 +6,7 @@ "scripts": { "test": "pnpm test-gnark", "test-gnark": "pnpm gnark-prover && ts-mocha --resolveJsonModule ./tsconfig.json -t 100000000 tests/gnark.test.ts --exit", + "test-circom": "ts-mocha --resolveJsonModule ./tsconfig.json -t 100000000 tests/circom.test.ts --exit", "gnark-prover": "./scripts/prover.sh", "format": "prettier --write \"tests/**/*.{ts,js}\" \"src/**/*.{ts,js}\"", "lint": "pnpm prettier \"tests/**/*.{ts,js}\" \"src/**/*.{ts,js}\" --check", diff --git a/circuit-lib/circuit-lib.js/tests/circom.test.ts b/circuit-lib/circuit-lib.js/tests/circom.test.ts new file mode 100644 index 0000000000..e6fda5cd99 --- /dev/null +++ b/circuit-lib/circuit-lib.js/tests/circom.test.ts @@ -0,0 +1,250 @@ +import { MerkleTree } from "../src"; +import { readFileSync, writeFileSync } from "fs"; +import { BN } from "@coral-xyz/anchor"; +import { WasmFactory } from "@lightprotocol/hasher.rs"; + +const snarkjs = require("snarkjs"); + +describe("Tests", () => { + function zk(prefix: string, tree_height: number, num_utxos: number): String { + return `../circuitlib-rs/test-data/${prefix}_${tree_height}_${num_utxos}/${prefix}_${tree_height}_${num_utxos}.zkey`; + } + + function wasm( + prefix: string, + tree_height: number, + num_utxos: number, + ): Buffer { + let path = `../circuitlib-rs/test-data/${prefix}_${tree_height}_${num_utxos}/${prefix}_${tree_height}_${num_utxos}.wasm`; + return readFileSync(path); + } + + function witnessGenerator(): any { + const path = "./utils/witness_calculator.js"; + return require(path); + } + + it.only("poseidon hash", async () => { + // const hasher = await WasmFactory.getInstance(); + // const hash = hasher.poseidonHashString(["1", "2", "3"]); + // console.log(hash.toString()); + // + // const hex = "e7732d89e6939c0ff03d5e58dab6302f3230e269dc5b968f725df34ab36d732"; + // // convert hex bigint string to BN and print + // const bn = new BN(hex, 16); + // console.log(bn.toString()); + + const s1 = "16085074336577330605427025562234956688941033672577493067094913142564547997332"; + const s2 ="17028464443381783825701736776944655616686180135429268021720746920802776315116"; + + const bn1 = new BN(s1); + const bn2 = new BN(s2); + + // convert to hex and print + console.log(bn1.toString(16)); + console.log(bn2.toString(16)); + + }); + + it("inclusion merkle proof", async () => { + const hasher = await WasmFactory.getInstance(); + const merkleHeights = [26]; + const utxos = [1]; //, 2, 3, 4, 8]; + const outPath = "/tmp"; + for (let i = 0; i < merkleHeights.length; i++) { + for (let j = 0; j < utxos.length; j++) { + const completePathZkey = zk("i", merkleHeights[i], utxos[j]); + const buffer = wasm("i", merkleHeights[i], utxos[j]); + const leaf = hasher.poseidonHashString(["1"]); + const merkleTree = new MerkleTree(merkleHeights[i], hasher, [leaf]); + + let inputs = { + root: new Array(utxos[j]).fill(merkleTree.root()), + inPathIndices: new Array(utxos[j]).fill(merkleTree.indexOf(leaf)), + inPathElements: new Array(utxos[j]).fill( + merkleTree.path(merkleTree.indexOf(leaf)).pathElements, + ), + leaf: new Array(utxos[j]).fill(leaf), + }; + + const inputs_json = JSON.stringify(inputs); + writeFileSync( + `${outPath}/inputs${merkleHeights[i]}_${utxos[j]}.json`, + inputs_json, + ); + + let generator = witnessGenerator(); + let witnessCalculator = await generator(buffer); + + console.time(`Witness generation for ${merkleHeights[i]} ${utxos[j]}`); + let wtns = await witnessCalculator.calculateWTNSBin(inputs, 0); + console.timeEnd( + `Witness generation for ${merkleHeights[i]} ${utxos[j]}`, + ); + + console.time(`Proof generation for ${merkleHeights[i]} ${utxos[j]}`); + const { proof, publicSignals } = await snarkjs.groth16.prove( + completePathZkey, + wtns, + ); + console.timeEnd(`Proof generation for ${merkleHeights[i]} ${utxos[j]}`); + + // write publicSignals to json file + const json = JSON.stringify(publicSignals); + writeFileSync( + `${outPath}/public_inputs_merkle${merkleHeights[i]}_${utxos[j]}.json`, + json, + ); + + const vKey = await snarkjs.zKey.exportVerificationKey(completePathZkey); + const res = await snarkjs.groth16.verify(vKey, publicSignals, proof); + if (res) { + console.log("Verification OK"); + } else { + console.log("Invalid proof"); + throw new Error("Invalid Proof"); + } + } + } + }); + + it("non-inclusion merkle proof", async () => { + const inputs13 = { + root: new BN( + "17028464443381783825701736776944655616686180135429268021720746920802776315116", + ), + value: 2, + leafLowerRangeValue: 1, + leafHigherRangeValue: 3, + leafIndex: 2, + + merkleProofHashedIndexedElementLeaf: [ + new BN( + "11053679896827771114580198143772188067284553252963177433523924515385729065733", + ), + new BN( + "19416991593757494280293241182306682833623412433910034999629278928521307384158", + ), + new BN( + "7423237065226347324353380772367382631490014989348495481811164164159255474657", + ), + new BN( + "11286972368698509976183087595462810875513684078608517520839298933882497716792", + ), + new BN( + "3607627140608796879659380071776844901612302623152076817094415224584923813162", + ), + new BN( + "19712377064642672829441595136074946683621277828620209496774504837737984048981", + ), + new BN( + "20775607673010627194014556968476266066927294572720319469184847051418138353016", + ), + new BN( + "3396914609616007258851405644437304192397291162432396347162513310381425243293", + ), + new BN( + "21551820661461729022865262380882070649935529853313286572328683688269863701601", + ), + new BN( + "6573136701248752079028194407151022595060682063033565181951145966236778420039", + ), + new BN( + "12413880268183407374852357075976609371175688755676981206018884971008854919922", + ), + new BN( + "14271763308400718165336499097156975241954733520325982997864342600795471836726", + ), + new BN( + "20066985985293572387227381049700832219069292839614107140851619262827735677018", + ), + new BN( + "9394776414966240069580838672673694685292165040808226440647796406499139370960", + ), + new BN( + "11331146992410411304059858900317123658895005918277453009197229807340014528524", + ), + new BN( + "15819538789928229930262697811477882737253464456578333862691129291651619515538", + ), + new BN( + "19217088683336594659449020493828377907203207941212636669271704950158751593251", + ), + new BN( + "21035245323335827719745544373081896983162834604456827698288649288827293579666", + ), + new BN( + "6939770416153240137322503476966641397417391950902474480970945462551409848591", + ), + new BN( + "10941962436777715901943463195175331263348098796018438960955633645115732864202", + ), + new BN( + "15019797232609675441998260052101280400536945603062888308240081994073687793470", + ), + new BN( + "11702828337982203149177882813338547876343922920234831094975924378932809409969", + ), + new BN( + "11217067736778784455593535811108456786943573747466706329920902520905755780395", + ), + new BN( + "16072238744996205792852194127671441602062027943016727953216607508365787157389", + ), + new BN( + "17681057402012993898104192736393849603097507831571622013521167331642182653248", + ), + new BN( + "21694045479371014653083846597424257852691458318143380497809004364947786214945", + ), + ], + indexHashedIndexedElementLeaf: 1, + }; + const merkleHeights = [26]; + const utxos = [1]; // [1, 2, 3, 4, 8]; + const outPath = "/tmp"; + for (let i = 0; i < merkleHeights.length; i++) { + for (let j = 0; j < utxos.length; j++) { + const completePathZkey = zk("ni", merkleHeights[i], utxos[j]); + const buffer = wasm("ni", merkleHeights[i], utxos[j]); + const inputs_json = JSON.stringify(inputs13); + // console.log(inputs_json); + writeFileSync( + `${outPath}/inputs${merkleHeights[i]}_${utxos[j]}.json`, + inputs_json, + ); + + let generator = witnessGenerator(); + let witnessCalculator = await generator(buffer); + + console.time(`Witness generation for ${merkleHeights[i]} ${utxos[j]}`); + let wtns = await witnessCalculator.calculateWTNSBin(inputs13, 0); + console.timeEnd( + `Witness generation for ${merkleHeights[i]} ${utxos[j]}`, + ); + + console.time(`Proof generation for ${merkleHeights[i]} ${utxos[j]}`); + const { proof, publicSignals } = await snarkjs.groth16.prove( + completePathZkey, + wtns, + ); + console.timeEnd(`Proof generation for ${merkleHeights[i]} ${utxos[j]}`); + + const json = JSON.stringify(publicSignals); + writeFileSync( + `${outPath}/public_inputs_merkle${merkleHeights[i]}_${utxos[j]}.json`, + json, + ); + + const vKey = await snarkjs.zKey.exportVerificationKey(completePathZkey); + const res = await snarkjs.groth16.verify(vKey, publicSignals, proof); + if (res) { + console.log("Verification OK"); + } else { + console.log("Invalid proof"); + throw new Error("Invalid Proof"); + } + } + } + }); +}); \ No newline at end of file diff --git a/circuit-lib/circuit-lib.js/tests/gnark.test.ts b/circuit-lib/circuit-lib.js/tests/gnark.test.ts index 7b8fb0afb5..3a220c5f1d 100644 --- a/circuit-lib/circuit-lib.js/tests/gnark.test.ts +++ b/circuit-lib/circuit-lib.js/tests/gnark.test.ts @@ -42,10 +42,10 @@ describe("Tests", () => { const leaf = hasher.poseidonHashString(["1"]); const merkleTree = new MerkleTree(merkleHeights[i], hasher, [leaf]); - const pathEements: string[] = merkleTree.path( + const pathElements: string[] = merkleTree.path( merkleTree.indexOf(leaf), ).pathElements; - const hexPathElements = pathEements.map((value) => toHex(value)); + const hexPathElements = pathElements.map((value) => toHex(value)); let inputs = { root: new Array(utxos[j]).fill(toHex(merkleTree.root())), inPathIndices: new Array(utxos[j]).fill(merkleTree.indexOf(leaf)), diff --git a/circuit-lib/circuit-lib.js/tests/utils/witness_calculator.js b/circuit-lib/circuit-lib.js/tests/utils/witness_calculator.js new file mode 100644 index 0000000000..26e7c462e4 --- /dev/null +++ b/circuit-lib/circuit-lib.js/tests/utils/witness_calculator.js @@ -0,0 +1,330 @@ +module.exports = async function builder(code, options) { + options = options || {}; + + let wasmModule; + try { + wasmModule = await WebAssembly.compile(code); + } catch (err) { + console.log(err); + console.log( + "\nTry to run circom --c in order to generate c++ code instead\n", + ); + throw new Error(err); + } + + let wc; + + let errStr = ""; + let msgStr = ""; + + const instance = await WebAssembly.instantiate(wasmModule, { + runtime: { + exceptionHandler: function (code) { + let err; + if (code == 1) { + err = "Signal not found.\n"; + } else if (code == 2) { + err = "Too many signals set.\n"; + } else if (code == 3) { + err = "Signal already set.\n"; + } else if (code == 4) { + err = "Assert Failed.\n"; + } else if (code == 5) { + err = "Not enough memory.\n"; + } else if (code == 6) { + err = "Input signal array access exceeds the size.\n"; + } else { + err = "Unknown error.\n"; + } + throw new Error(err + errStr); + }, + printErrorMessage: function () { + errStr += getMessage() + "\n"; + // console.error(getMessage()); + }, + writeBufferMessage: function () { + const msg = getMessage(); + // Any calls to `log()` will always end with a `\n`, so that's when we print and reset + if (msg === "\n") { + console.log(msgStr); + msgStr = ""; + } else { + // If we've buffered other content, put a space in between the items + if (msgStr !== "") { + msgStr += " "; + } + // Then append the message to the message we are creating + msgStr += msg; + } + }, + showSharedRWMemory: function () { + printSharedRWMemory(); + }, + }, + }); + + const sanityCheck = options; + // options && + // ( + // options.sanityCheck || + // options.logGetSignal || + // options.logSetSignal || + // options.logStartComponent || + // options.logFinishComponent + // ); + + wc = new WitnessCalculator(instance, sanityCheck); + return wc; + + function getMessage() { + var message = ""; + var c = instance.exports.getMessageChar(); + while (c != 0) { + message += String.fromCharCode(c); + c = instance.exports.getMessageChar(); + } + return message; + } + + function printSharedRWMemory() { + const shared_rw_memory_size = instance.exports.getFieldNumLen32(); + const arr = new Uint32Array(shared_rw_memory_size); + for (let j = 0; j < shared_rw_memory_size; j++) { + arr[shared_rw_memory_size - 1 - j] = + instance.exports.readSharedRWMemory(j); + } + + // If we've buffered other content, put a space in between the items + if (msgStr !== "") { + msgStr += " "; + } + // Then append the value to the message we are creating + msgStr += fromArray32(arr).toString(); + } +}; + +class WitnessCalculator { + constructor(instance, sanityCheck) { + this.instance = instance; + + this.version = this.instance.exports.getVersion(); + this.n32 = this.instance.exports.getFieldNumLen32(); + + this.instance.exports.getRawPrime(); + const arr = new Uint32Array(this.n32); + for (let i = 0; i < this.n32; i++) { + arr[this.n32 - 1 - i] = this.instance.exports.readSharedRWMemory(i); + } + this.prime = fromArray32(arr); + + this.witnessSize = this.instance.exports.getWitnessSize(); + + this.sanityCheck = sanityCheck; + } + + circom_version() { + return this.instance.exports.getVersion(); + } + + async _doCalculateWitness(input, sanityCheck) { + //input is assumed to be a map from signals to arrays of bigints + this.instance.exports.init(this.sanityCheck || sanityCheck ? 1 : 0); + const keys = Object.keys(input); + var input_counter = 0; + keys.forEach((k) => { + const h = fnvHash(k); + const hMSB = parseInt(h.slice(0, 8), 16); + const hLSB = parseInt(h.slice(8, 16), 16); + const fArr = flatArray(input[k]); + let signalSize = this.instance.exports.getInputSignalSize(hMSB, hLSB); + if (signalSize < 0) { + throw new Error(`Signal ${k} not found\n`); + } + if (fArr.length < signalSize) { + throw new Error(`Not enough values for input signal ${k}\n`); + } + if (fArr.length > signalSize) { + throw new Error(`Too many values for input signal ${k}\n`); + } + for (let i = 0; i < fArr.length; i++) { + const arrFr = toArray32(normalize(fArr[i], this.prime), this.n32); + for (let j = 0; j < this.n32; j++) { + this.instance.exports.writeSharedRWMemory(j, arrFr[this.n32 - 1 - j]); + } + try { + this.instance.exports.setInputSignal(hMSB, hLSB, i); + input_counter++; + } catch (err) { + // console.log(`After adding signal ${i} of ${k}`) + throw new Error(err); + } + } + }); + if (input_counter < this.instance.exports.getInputSize()) { + throw new Error( + `Not all inputs have been set. Only ${input_counter} out of ${this.instance.exports.getInputSize()}`, + ); + } + } + + async calculateWitness(input, sanityCheck) { + const w = []; + + await this._doCalculateWitness(input, sanityCheck); + + for (let i = 0; i < this.witnessSize; i++) { + this.instance.exports.getWitness(i); + const arr = new Uint32Array(this.n32); + for (let j = 0; j < this.n32; j++) { + arr[this.n32 - 1 - j] = this.instance.exports.readSharedRWMemory(j); + } + w.push(fromArray32(arr)); + } + + return w; + } + + async calculateBinWitness(input, sanityCheck) { + const buff32 = new Uint32Array(this.witnessSize * this.n32); + const buff = new Uint8Array(buff32.buffer); + await this._doCalculateWitness(input, sanityCheck); + + for (let i = 0; i < this.witnessSize; i++) { + this.instance.exports.getWitness(i); + const pos = i * this.n32; + for (let j = 0; j < this.n32; j++) { + buff32[pos + j] = this.instance.exports.readSharedRWMemory(j); + } + } + + return buff; + } + + async calculateWTNSBin(input, sanityCheck) { + const buff32 = new Uint32Array(this.witnessSize * this.n32 + this.n32 + 11); + const buff = new Uint8Array(buff32.buffer); + await this._doCalculateWitness(input, sanityCheck); + + //"wtns" + buff[0] = "w".charCodeAt(0); + buff[1] = "t".charCodeAt(0); + buff[2] = "n".charCodeAt(0); + buff[3] = "s".charCodeAt(0); + + //version 2 + buff32[1] = 2; + + //number of sections: 2 + buff32[2] = 2; + + //id section 1 + buff32[3] = 1; + + const n8 = this.n32 * 4; + //id section 1 length in 64bytes + const idSection1length = 8 + n8; + const idSection1lengthHex = idSection1length.toString(16); + buff32[4] = parseInt(idSection1lengthHex.slice(0, 8), 16); + buff32[5] = parseInt(idSection1lengthHex.slice(8, 16), 16); + + //this.n32 + buff32[6] = n8; + + //prime number + this.instance.exports.getRawPrime(); + + var pos = 7; + for (let j = 0; j < this.n32; j++) { + buff32[pos + j] = this.instance.exports.readSharedRWMemory(j); + } + pos += this.n32; + + // witness size + buff32[pos] = this.witnessSize; + pos++; + + //id section 2 + buff32[pos] = 2; + pos++; + + // section 2 length + const idSection2length = n8 * this.witnessSize; + const idSection2lengthHex = idSection2length.toString(16); + buff32[pos] = parseInt(idSection2lengthHex.slice(0, 8), 16); + buff32[pos + 1] = parseInt(idSection2lengthHex.slice(8, 16), 16); + + pos += 2; + for (let i = 0; i < this.witnessSize; i++) { + this.instance.exports.getWitness(i); + for (let j = 0; j < this.n32; j++) { + buff32[pos + j] = this.instance.exports.readSharedRWMemory(j); + } + pos += this.n32; + } + + return buff; + } +} + +function toArray32(rem, size) { + const res = []; //new Uint32Array(size); //has no unshift + const radix = BigInt(0x100000000); + while (rem) { + res.unshift(Number(rem % radix)); + rem = rem / radix; + } + if (size) { + var i = size - res.length; + while (i > 0) { + res.unshift(0); + i--; + } + } + return res; +} + +function fromArray32(arr) { + //returns a BigInt + var res = BigInt(0); + const radix = BigInt(0x100000000); + for (let i = 0; i < arr.length; i++) { + res = res * radix + BigInt(arr[i]); + } + return res; +} + +function flatArray(a) { + var res = []; + fillArray(res, a); + return res; + + function fillArray(res, a) { + if (Array.isArray(a)) { + for (let i = 0; i < a.length; i++) { + fillArray(res, a[i]); + } + } else { + res.push(a); + } + } +} + +function normalize(n, prime) { + let res = BigInt(n) % prime; + if (res < 0) res += prime; + return res; +} + +function fnvHash(str) { + const uint64_max = BigInt(2) ** BigInt(64); + let hash = BigInt("0xCBF29CE484222325"); + for (var i = 0; i < str.length; i++) { + hash ^= BigInt(str[i].charCodeAt()); + hash *= BigInt(0x100000001b3); + hash %= uint64_max; + } + let shash = hash.toString(16); + let n = 16 - shash.length; + shash = "0".repeat(n).concat(shash); + return shash; +} \ No newline at end of file diff --git a/gnark-prover/config.toml b/gnark-prover/config.toml index ffe302a4d5..a885d18b0d 100644 --- a/gnark-prover/config.toml +++ b/gnark-prover/config.toml @@ -4,4 +4,9 @@ keys = [ "circuits/inclusion_26_3.key", "circuits/inclusion_26_4.key", "circuits/inclusion_26_8.key", + "circuits/non-inclusion_26_1.key", + "circuits/non-inclusion_26_2.key", + "circuits/non-inclusion_26_3.key", + "circuits/non-inclusion_26_4.key", + "circuits/non-inclusion_26_8.key" ] \ No newline at end of file diff --git a/gnark-prover/generate_keys.sh b/gnark-prover/generate_keys.sh index a9b9d59fcc..31bf53913b 100755 --- a/gnark-prover/generate_keys.sh +++ b/gnark-prover/generate_keys.sh @@ -16,7 +16,7 @@ generate() { CIRCUIT_VKEY_RS_FILE="../programs/compressed-pda/src/verifying_keys/${CIRCUIT_TYPE}_${DEPTH}_${UTXOS}.rs" echo "Generating ${CIRCUIT_TYPE} circuit for ${UTXOS} UTXOs..." - gnark setup --utxos "$UTXOS" --tree-depth "$DEPTH" --output "${CIRCUIT_FILE}" --output-vkey "${CIRCUIT_VKEY_FILE}" + gnark setup --circuit "${CIRCUIT_TYPE}" --utxos "$UTXOS" --tree-depth "$DEPTH" --output "${CIRCUIT_FILE}" --output-vkey "${CIRCUIT_VKEY_FILE}" cargo xtask generate-vkey-rs --input-path "${CIRCUIT_VKEY_FILE}" --output-path "${CIRCUIT_VKEY_RS_FILE}" } @@ -24,5 +24,6 @@ declare -a utxos_arr=("1" "2" "3" "4" "8") for utxos in "${utxos_arr[@]}" do - generate $utxos "inclusion" + generate "$utxos" "inclusion" + generate "$utxos" "non-inclusion" done \ No newline at end of file diff --git a/gnark-prover/integration_test.go b/gnark-prover/integration_test.go index d45b6f2193..9a1d36c03d 100644 --- a/gnark-prover/integration_test.go +++ b/gnark-prover/integration_test.go @@ -268,3 +268,16 @@ func TestParsingEmptyTreeWithOneLeaf(t *testing.T) { } } } + +func TestNonInclusionHappyPath26_1_JSON(t *testing.T) { + testInput := ` + {"root":["0x25a5c4f28064c652bb113742eedc9d1c8b5beb96d633ff4fde5e584a6534f4ec"],"value":["0x2"],"leafLowerRangeValue":["0x1"],"leafHigherRangeValue":["0x3"],"leafIndex":[2],"inPathElements":[["0x1870293e9c4572d377d13ee4d3a10bd0aadc2b2804e159a088b5b066e2afa305","0x2aeda0b6795f709a521e3ca32c7d865d64d58d100b2ac064a91a2e638354695e","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x07f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x078295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0x0e884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0x0f57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"]],"inPathIndices":[1]} +` + response, err := http.Post("http://"+ProverAddress+"/noninclusion", "application/json", strings.NewReader(testInput)) + if err != nil { + t.Fatal(err) + } + if response.StatusCode != http.StatusOK { + t.Fatalf("Expected status code %d, got %d", http.StatusOK, response.StatusCode) + } +} diff --git a/gnark-prover/main.go b/gnark-prover/main.go index 2de61fae6d..6243cb49c4 100644 --- a/gnark-prover/main.go +++ b/gnark-prover/main.go @@ -33,12 +33,14 @@ func runCli() { { Name: "setup", Flags: []cli.Flag{ + &cli.StringFlag{Name: "circuit", Usage: "Type of circuit (\"inclusion\" / \"non-inclusion\" / \"combined\")", Required: true}, &cli.StringFlag{Name: "output", Usage: "Output file", Required: true}, &cli.StringFlag{Name: "output-vkey", Usage: "Output file", Required: true}, &cli.UintFlag{Name: "tree-depth", Usage: "Merkle tree depth", Required: true}, &cli.UintFlag{Name: "utxos", Usage: "Number of Utxos", Required: true}, }, Action: func(context *cli.Context) error { + circuit := context.String("circuit") path := context.String("output") path_vkey := context.String("output-vkey") treeDepth := uint32(context.Uint("tree-depth")) @@ -47,8 +49,7 @@ func runCli() { var system *prover.ProvingSystem var err error - system, err = prover.SetupCircuit("inclusion", treeDepth, numberOfUtxos) - + system, err = prover.SetupCircuit(circuit, treeDepth, numberOfUtxos) if err != nil { return err } @@ -442,6 +443,11 @@ func LoadKeysFromConfigOrInline(context *cli.Context) ([]*prover.ProvingSystem, "circuits/inclusion_26_3.key", "circuits/inclusion_26_4.key", "circuits/inclusion_26_8.key", + "circuits/non-inclusion_26_1.key", + "circuits/non-inclusion_26_2.key", + "circuits/non-inclusion_26_3.key", + "circuits/non-inclusion_26_4.key", + "circuits/non-inclusion_26_8.key", }, } } diff --git a/gnark-prover/prover/circuit_builder.go b/gnark-prover/prover/circuit_builder.go index 5723d93203..3a92edd94b 100644 --- a/gnark-prover/prover/circuit_builder.go +++ b/gnark-prover/prover/circuit_builder.go @@ -5,6 +5,10 @@ import "fmt" func SetupCircuit(circuit string, treeDepth uint32, numberOfUtxos uint32) (*ProvingSystem, error) { if circuit == "inclusion" { return SetupInclusion(treeDepth, numberOfUtxos) + } else if circuit == "non-inclusion" { + return SetupNonInclusion(treeDepth, numberOfUtxos) + } else if circuit == "combined" { + return nil, fmt.Errorf("TODO: implement combine circuit: %s", circuit) } else { return nil, fmt.Errorf("invalid circuit: %s", circuit) } diff --git a/gnark-prover/prover/circuit_utils.go b/gnark-prover/prover/circuit_utils.go index b91232e59d..75d6944283 100644 --- a/gnark-prover/prover/circuit_utils.go +++ b/gnark-prover/prover/circuit_utils.go @@ -51,6 +51,21 @@ type InclusionProof struct { Depth int } +type NonInclusionProof struct { + Root []frontend.Variable + Value []frontend.Variable + + LeafLowerRangeValue []frontend.Variable + LeafHigherRangeValue []frontend.Variable + LeafIndex []frontend.Variable + + InPathIndices []frontend.Variable + InPathElements [][]frontend.Variable + + NumberOfUtxos int + Depth int +} + func (gadget InclusionProof) DefineGadget(api frontend.API) interface{} { currentHash := make([]frontend.Variable, gadget.NumberOfUtxos) for proofIndex := 0; proofIndex < gadget.NumberOfUtxos; proofIndex++ { @@ -63,6 +78,27 @@ func (gadget InclusionProof) DefineGadget(api frontend.API) interface{} { return currentHash } +func (gadget NonInclusionProof) DefineGadget(api frontend.API) interface{} { + currentHash := make([]frontend.Variable, gadget.NumberOfUtxos) + for proofIndex := 0; proofIndex < gadget.NumberOfUtxos; proofIndex++ { + + api.AssertIsDifferent(gadget.LeafLowerRangeValue[proofIndex], gadget.Value[proofIndex]) + api.AssertIsLessOrEqual(gadget.LeafLowerRangeValue[proofIndex], gadget.Value[proofIndex]) + + api.AssertIsDifferent(gadget.LeafHigherRangeValue[proofIndex], gadget.Value[proofIndex]) + api.AssertIsLessOrEqual(gadget.Value[proofIndex], gadget.LeafHigherRangeValue[proofIndex]) + + leaf := abstractor.Call(api, poseidon.Poseidon3{In1: gadget.LeafLowerRangeValue[proofIndex], In2: gadget.LeafIndex[proofIndex], In3: gadget.LeafHigherRangeValue[proofIndex]}) + currentHash[proofIndex] = leaf + + currentPath := api.ToBinary(gadget.InPathIndices[proofIndex], gadget.Depth) + for j := 0; j < gadget.Depth; j++ { + currentHash[proofIndex] = abstractor.Call(api, ProofRound{Direction: currentPath[j], Hash: currentHash[proofIndex], Sibling: gadget.InPathElements[proofIndex][j]}) + } + } + return currentHash +} + // Trusted setup utility functions // Taken from: https://github.com/bnb-chain/zkbnb/blob/master/common/prove/proof_keys.go#L19 func LoadProvingKey(filepath string) (pk groth16.ProvingKey, err error) { diff --git a/gnark-prover/prover/marshal_non_inclusion.go b/gnark-prover/prover/marshal_non_inclusion.go new file mode 100644 index 0000000000..578c714739 --- /dev/null +++ b/gnark-prover/prover/marshal_non_inclusion.go @@ -0,0 +1,136 @@ +package prover + +import ( + "encoding/json" + "fmt" + "math/big" +) + +type NonInclusionParametersJSON struct { + Root []string `json:"root"` + InPathIndices []uint32 `json:"inPathIndices"` + InPathElements [][]string `json:"inPathElements"` + Value []string `json:"value"` + + LeafLowerRangeValue []string `json:"leafLowerRangeValue"` + LeafHigherRangeValue []string `json:"leafHigherRangeValue"` + LeafIndex []uint32 `json:"leafIndex"` +} + +func ParseNonInclusion(inputJSON string) (NonInclusionParameters, error) { + var proofData NonInclusionParameters + err := json.Unmarshal([]byte(inputJSON), &proofData) + if err != nil { + return NonInclusionParameters{}, fmt.Errorf("error parsing JSON: %v", err) + } + return proofData, nil +} + +func (p *NonInclusionParameters) MarshalJSON() ([]byte, error) { + paramsJson := NonInclusionParametersJSON{} + + paramsJson.Root = make([]string, len(p.Root)) + for i := 0; i < len(p.Root); i++ { + paramsJson.Root[i] = toHex(&p.Root[i]) + } + + paramsJson.Value = make([]string, len(p.Value)) + for i := 0; i < len(p.Value); i++ { + paramsJson.Value[i] = toHex(&p.Value[i]) + } + + paramsJson.LeafLowerRangeValue = make([]string, len(p.LeafLowerRangeValue)) + for i := 0; i < len(p.LeafLowerRangeValue); i++ { + paramsJson.LeafLowerRangeValue[i] = toHex(&p.LeafLowerRangeValue[i]) + } + + paramsJson.LeafHigherRangeValue = make([]string, len(p.LeafHigherRangeValue)) + for i := 0; i < len(p.LeafHigherRangeValue); i++ { + paramsJson.LeafHigherRangeValue[i] = toHex(&p.LeafHigherRangeValue[i]) + } + + paramsJson.LeafIndex = make([]uint32, len(p.LeafIndex)) + for i := 0; i < len(p.LeafIndex); i++ { + paramsJson.LeafIndex[i] = p.LeafIndex[i] + } + + paramsJson.InPathIndices = make([]uint32, len(p.InPathIndices)) + for i := 0; i < len(p.InPathIndices); i++ { + paramsJson.InPathIndices[i] = p.InPathIndices[i] + } + + paramsJson.InPathElements = make([][]string, len(p.InPathElements)) + for i := 0; i < len(p.InPathElements); i++ { + paramsJson.InPathElements[i] = make([]string, len(p.InPathElements[i])) + for j := 0; j < len(p.InPathElements[i]); j++ { + paramsJson.InPathElements[i][j] = toHex(&p.InPathElements[i][j]) + } + } + + return json.Marshal(paramsJson) +} + +func (p *NonInclusionParameters) UnmarshalJSON(data []byte) error { + + var params NonInclusionParametersJSON + + err := json.Unmarshal(data, ¶ms) + if err != nil { + return err + } + + p.Root = make([]big.Int, len(params.Root)) + for i := 0; i < len(params.Root); i++ { + err = fromHex(&p.Root[i], params.Root[i]) + if err != nil { + return err + } + } + + p.Value = make([]big.Int, len(params.Value)) + for i := 0; i < len(params.Value); i++ { + err = fromHex(&p.Value[i], params.Value[i]) + if err != nil { + return err + } + } + + p.LeafLowerRangeValue = make([]big.Int, len(params.LeafLowerRangeValue)) + for i := 0; i < len(params.LeafLowerRangeValue); i++ { + err = fromHex(&p.LeafLowerRangeValue[i], params.LeafLowerRangeValue[i]) + if err != nil { + return err + } + } + + p.LeafHigherRangeValue = make([]big.Int, len(params.LeafHigherRangeValue)) + for i := 0; i < len(params.LeafHigherRangeValue); i++ { + err = fromHex(&p.LeafHigherRangeValue[i], params.LeafHigherRangeValue[i]) + if err != nil { + return err + } + } + + p.LeafIndex = make([]uint32, len(params.LeafIndex)) + for i := 0; i < len(params.LeafIndex); i++ { + p.LeafIndex[i] = params.LeafIndex[i] + } + + p.InPathIndices = make([]uint32, len(params.InPathIndices)) + for i := 0; i < len(params.InPathIndices); i++ { + p.InPathIndices[i] = params.InPathIndices[i] + } + + p.InPathElements = make([][]big.Int, len(params.InPathElements)) + for i := 0; i < len(params.InPathElements); i++ { + p.InPathElements[i] = make([]big.Int, len(params.InPathElements[i])) + for j := 0; j < len(params.InPathElements[i]); j++ { + err = fromHex(&p.InPathElements[i][j], params.InPathElements[i][j]) + if err != nil { + return err + } + } + } + + return nil +} diff --git a/gnark-prover/prover/non_inclusion_circuit.go b/gnark-prover/prover/non_inclusion_circuit.go new file mode 100644 index 0000000000..d70022a421 --- /dev/null +++ b/gnark-prover/prover/non_inclusion_circuit.go @@ -0,0 +1,97 @@ +package prover + +import ( + "github.com/consensys/gnark-crypto/ecc" + "github.com/consensys/gnark/frontend" + "github.com/consensys/gnark/frontend/cs/r1cs" + "github.com/reilabs/gnark-lean-extractor/v2/abstractor" +) + +type NonInclusionCircuit struct { + // public inputs + Root []frontend.Variable `gnark:",public"` + Value []frontend.Variable `gnark:",public"` + + // private inputs + + LeafLowerRangeValue []frontend.Variable `gnark:"input"` + LeafHigherRangeValue []frontend.Variable `gnark:"input"` + LeafIndex []frontend.Variable `gnark:"input"` + + InPathIndices []frontend.Variable `gnark:"input"` + InPathElements [][]frontend.Variable `gnark:"input"` + + NumberOfUtxos int + Depth int +} + +func (circuit *NonInclusionCircuit) Define(api frontend.API) error { + roots := + abstractor.Call1(api, NonInclusionProof{ + Root: circuit.Root, + Value: circuit.Value, + + LeafLowerRangeValue: circuit.LeafLowerRangeValue, + LeafHigherRangeValue: circuit.LeafHigherRangeValue, + LeafIndex: circuit.LeafIndex, + + InPathElements: circuit.InPathElements, + InPathIndices: circuit.InPathIndices, + + NumberOfUtxos: circuit.NumberOfUtxos, + Depth: circuit.Depth, + }) + + for i := 0; i < circuit.NumberOfUtxos; i++ { + api.AssertIsEqual(roots[i], circuit.Root[i]) + } + + return nil +} + +func ImportNonInclusionSetup(treeDepth uint32, numberOfUtxos uint32, pkPath string, vkPath string) (*ProvingSystem, error) { + root := make([]frontend.Variable, numberOfUtxos) + value := make([]frontend.Variable, numberOfUtxos) + + leafLowerRangeValue := make([]frontend.Variable, numberOfUtxos) + leafHigherRangeValue := make([]frontend.Variable, numberOfUtxos) + leafIndex := make([]frontend.Variable, numberOfUtxos) + + inPathIndices := make([]frontend.Variable, numberOfUtxos) + inPathElements := make([][]frontend.Variable, numberOfUtxos) + + for i := 0; i < int(numberOfUtxos); i++ { + inPathElements[i] = make([]frontend.Variable, treeDepth) + } + + circuit := NonInclusionCircuit{ + Depth: int(treeDepth), + NumberOfUtxos: int(numberOfUtxos), + Root: root, + Value: value, + LeafLowerRangeValue: leafLowerRangeValue, + LeafHigherRangeValue: leafHigherRangeValue, + LeafIndex: leafIndex, + InPathIndices: inPathIndices, + InPathElements: inPathElements, + } + + ccs, err := frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit) + if err != nil { + return nil, err + } + + pk, err := LoadProvingKey(pkPath) + + if err != nil { + return nil, err + } + + vk, err := LoadVerifyingKey(vkPath) + + if err != nil { + return nil, err + } + + return &ProvingSystem{treeDepth, numberOfUtxos, false, pk, vk, ccs}, nil +} diff --git a/gnark-prover/prover/non_inclusion_proving_system.go b/gnark-prover/prover/non_inclusion_proving_system.go new file mode 100644 index 0000000000..3b7614135c --- /dev/null +++ b/gnark-prover/prover/non_inclusion_proving_system.go @@ -0,0 +1,163 @@ +package prover + +import ( + "fmt" + "light/light-prover/logging" + "math/big" + "strconv" + + "github.com/consensys/gnark-crypto/ecc" + "github.com/consensys/gnark/backend/groth16" + "github.com/consensys/gnark/constraint" + "github.com/consensys/gnark/frontend" + "github.com/consensys/gnark/frontend/cs/r1cs" +) + +type NonInclusionParameters struct { + Root []big.Int + Value []big.Int + + LeafLowerRangeValue []big.Int + LeafHigherRangeValue []big.Int + LeafIndex []uint32 + + InPathIndices []uint32 + InPathElements [][]big.Int +} + +func (p *NonInclusionParameters) NumberOfUTXOs() uint32 { + return uint32(len(p.Root)) +} + +func (p *NonInclusionParameters) TreeDepth() uint32 { + if len(p.InPathElements) == 0 { + return 0 + } + return uint32(len(p.InPathElements[0])) +} + +func (p *NonInclusionParameters) ValidateShape(treeDepth uint32, numOfUTXOs uint32) error { + if p.NumberOfUTXOs() != numOfUTXOs { + return fmt.Errorf("wrong number of utxos: %d", len(p.Root)) + } + if p.TreeDepth() != treeDepth { + return fmt.Errorf("wrong size of merkle proof for proof %d: %d", p.NumberOfUTXOs(), p.TreeDepth()) + } + return nil +} + +func R1CSNonInclusion(treeDepth uint32, numberOfUtxos uint32) (constraint.ConstraintSystem, error) { + root := make([]frontend.Variable, numberOfUtxos) + value := make([]frontend.Variable, numberOfUtxos) + + leafLowerRangeValue := make([]frontend.Variable, numberOfUtxos) + leafHigherRangeValue := make([]frontend.Variable, numberOfUtxos) + leafIndex := make([]frontend.Variable, numberOfUtxos) + + inPathIndices := make([]frontend.Variable, numberOfUtxos) + inPathElements := make([][]frontend.Variable, numberOfUtxos) + + for i := 0; i < int(numberOfUtxos); i++ { + inPathElements[i] = make([]frontend.Variable, treeDepth) + } + + circuit := NonInclusionCircuit{ + Depth: int(treeDepth), + NumberOfUtxos: int(numberOfUtxos), + Root: root, + Value: value, + LeafLowerRangeValue: leafLowerRangeValue, + LeafHigherRangeValue: leafHigherRangeValue, + LeafIndex: leafIndex, + InPathIndices: inPathIndices, + InPathElements: inPathElements, + } + return frontend.Compile(ecc.BN254.ScalarField(), r1cs.NewBuilder, &circuit) +} + +func SetupNonInclusion(treeDepth uint32, numberOfUtxos uint32) (*ProvingSystem, error) { + ccs, err := R1CSNonInclusion(treeDepth, numberOfUtxos) + if err != nil { + return nil, err + } + pk, vk, err := groth16.Setup(ccs) + if err != nil { + return nil, err + } + return &ProvingSystem{treeDepth, numberOfUtxos, false, pk, vk, ccs}, nil +} + +func (ps *ProvingSystem) ProveNonInclusion(params *NonInclusionParameters) (*Proof, error) { + if err := params.ValidateShape(ps.TreeDepth, ps.NumberOfUtxos); err != nil { + return nil, err + } + + root := make([]frontend.Variable, ps.NumberOfUtxos) + value := make([]frontend.Variable, ps.NumberOfUtxos) + + leafLowerRangeValue := make([]frontend.Variable, ps.NumberOfUtxos) + leafHigherRangeValue := make([]frontend.Variable, ps.NumberOfUtxos) + leafIndex := make([]frontend.Variable, ps.NumberOfUtxos) + + inPathElements := make([][]frontend.Variable, ps.NumberOfUtxos) + inPathIndices := make([]frontend.Variable, ps.NumberOfUtxos) + + for i := 0; i < int(ps.NumberOfUtxos); i++ { + root[i] = params.Root[i] + value[i] = params.Value[i] + leafLowerRangeValue[i] = params.LeafLowerRangeValue[i] + leafHigherRangeValue[i] = params.LeafHigherRangeValue[i] + leafIndex[i] = params.LeafIndex[i] + inPathIndices[i] = params.InPathIndices[i] + inPathElements[i] = make([]frontend.Variable, ps.TreeDepth) + for j := 0; j < int(ps.TreeDepth); j++ { + inPathElements[i][j] = params.InPathElements[i][j] + } + } + + assignment := NonInclusionCircuit{ + Root: root, + Value: value, + LeafLowerRangeValue: leafLowerRangeValue, + LeafHigherRangeValue: leafHigherRangeValue, + LeafIndex: leafIndex, + InPathIndices: inPathIndices, + InPathElements: inPathElements, + } + + witness, err := frontend.NewWitness(&assignment, ecc.BN254.ScalarField()) + if err != nil { + return nil, err + } + + logging.Logger().Info().Msg("Proof non-inclusion" + strconv.Itoa(int(ps.TreeDepth)) + " " + strconv.Itoa(int(ps.NumberOfUtxos))) + proof, err := groth16.Prove(ps.ConstraintSystem, ps.ProvingKey, witness) + if err != nil { + logging.Logger().Error().Msg("non-inclusion prove error: " + err.Error()) + return nil, err + } + + return &Proof{proof}, nil +} + +func (ps *ProvingSystem) VerifyNonInclusion(root []big.Int, value []big.Int, proof *Proof) error { + rootArray := make([]frontend.Variable, ps.NumberOfUtxos) + for i, v := range root { + rootArray[i] = v + } + + valueArray := make([]frontend.Variable, ps.NumberOfUtxos) + for i, v := range value { + valueArray[i] = v + } + + publicAssignment := NonInclusionCircuit{ + Root: rootArray, + Value: valueArray, + } + witness, err := frontend.NewWitness(&publicAssignment, ecc.BN254.ScalarField(), frontend.PublicOnly()) + if err != nil { + return err + } + return groth16.Verify(proof.Proof, ps.VerifyingKey, witness) +} diff --git a/gnark-prover/prover/non_inclusion_test.go b/gnark-prover/prover/non_inclusion_test.go new file mode 100644 index 0000000000..a40dfcf478 --- /dev/null +++ b/gnark-prover/prover/non_inclusion_test.go @@ -0,0 +1,132 @@ +package prover + +import ( + "bufio" + "encoding/json" + "fmt" + "github.com/consensys/gnark-crypto/ecc" + "github.com/consensys/gnark/backend" + "github.com/consensys/gnark/frontend" + "github.com/consensys/gnark/test" + "os" + "strings" + "testing" +) + +// Iterate over data from csv file "inclusion_test_data.tsv", which contains test data for the inclusion proof. +// The file has two columns, separated by a semicolon. +// First column is the expected result, second column is the input. +// For each row, run the test with the input and check if the result is as expected. +func TestNonInclusion(t *testing.T) { + assert := test.NewAssert(t) + + file, err := os.Open("../test-data/non_inclusion.csv") + defer file.Close() + + assert.Nil(err, "Error opening file: ", err) + + scanner := bufio.NewScanner(file) + for scanner.Scan() { + line := scanner.Text() + if line == "" { + continue + } + splitLine := strings.Split(line, ";") + assert.Equal(len(splitLine), 2, "Invalid line: ", line) + + var params NonInclusionParameters + err := json.Unmarshal([]byte(splitLine[1]), ¶ms) + assert.Nil(err, "Error unmarshalling inputs: ", err) + + var numberOfUtxos = len(params.Root) + var treeDepth = len(params.InPathElements[0]) + + root := make([]frontend.Variable, numberOfUtxos) + for i, v := range params.Root { + root[i] = v + } + + value := make([]frontend.Variable, numberOfUtxos) + for i, v := range params.Value { + value[i] = v + } + + leafLowerRangeValue := make([]frontend.Variable, numberOfUtxos) + for i, v := range params.LeafLowerRangeValue { + leafLowerRangeValue[i] = v + } + + leafHigherRangeValue := make([]frontend.Variable, numberOfUtxos) + for i, v := range params.LeafHigherRangeValue { + leafHigherRangeValue[i] = v + } + + leafIndex := make([]frontend.Variable, numberOfUtxos) + for i, v := range params.LeafIndex { + leafIndex[i] = v + } + + inPathIndices := make([]frontend.Variable, numberOfUtxos) + for i, v := range params.InPathIndices { + inPathIndices[i] = v + } + + inPathElements := make([][]frontend.Variable, numberOfUtxos) + for i := 0; i < int(numberOfUtxos); i++ { + inPathElements[i] = make([]frontend.Variable, treeDepth) + } + + for i, v := range params.InPathElements { + for j, v2 := range v { + inPathElements[i][j] = v2 + } + } + + var circuit NonInclusionCircuit + circuit.Root = make([]frontend.Variable, numberOfUtxos) + circuit.Value = make([]frontend.Variable, numberOfUtxos) + circuit.LeafLowerRangeValue = make([]frontend.Variable, numberOfUtxos) + circuit.LeafHigherRangeValue = make([]frontend.Variable, numberOfUtxos) + circuit.LeafIndex = make([]frontend.Variable, numberOfUtxos) + circuit.InPathIndices = make([]frontend.Variable, numberOfUtxos) + circuit.InPathElements = make([][]frontend.Variable, numberOfUtxos) + for i := 0; i < int(numberOfUtxos); i++ { + circuit.InPathElements[i] = make([]frontend.Variable, treeDepth) + } + + circuit.NumberOfUtxos = int(numberOfUtxos) + circuit.Depth = int(treeDepth) + + // Check if the expected result is "true" or "false" + expectedResult := splitLine[0] + if expectedResult == "0" { + // Run the failing test + assert.ProverFailed(&circuit, &NonInclusionCircuit{ + Root: root, + Value: value, + LeafLowerRangeValue: leafLowerRangeValue, + LeafHigherRangeValue: leafHigherRangeValue, + LeafIndex: leafIndex, + InPathIndices: inPathIndices, + InPathElements: inPathElements, + NumberOfUtxos: numberOfUtxos, + Depth: treeDepth, + }, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254), test.NoSerialization()) + } else if expectedResult == "1" { + // Run the passing test + assert.ProverSucceeded(&circuit, &NonInclusionCircuit{ + Root: root, + Value: value, + LeafLowerRangeValue: leafLowerRangeValue, + LeafHigherRangeValue: leafHigherRangeValue, + LeafIndex: leafIndex, + InPathIndices: inPathIndices, + InPathElements: inPathElements, + NumberOfUtxos: numberOfUtxos, + Depth: treeDepth, + }, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254), test.NoSerialization()) + } else { + fmt.Println("Invalid expected result: ", expectedResult) + } + } +} diff --git a/gnark-prover/prover/poseidon/constants.go b/gnark-prover/prover/poseidon/constants.go index d6c159b97d..165502928e 100644 --- a/gnark-prover/prover/poseidon/constants.go +++ b/gnark-prover/prover/poseidon/constants.go @@ -8,8 +8,7 @@ import ( func hex(s string) big.Int { var bi big.Int - bi.SetString(s, - 0) + bi.SetString(s, 0) return bi } @@ -500,3 +499,417 @@ var CONSTANTS_3 = [][]frontend.Variable{ hex("0x1da55cc900f0d21f4a3e694391918a1b3c23b2ac773c6b3ef88e2e4228325161"), }, } + +var MDS_4 = [][]frontend.Variable{ + { + hex("0x236d13393ef85cc48a351dd786dd7a1de5e39942296127fd87947223ae5108ad"), + hex("0x277686494f7644bbc4a9b194e10724eb967f1dc58718e59e3cedc821b2a7ae19"), + hex("0x023db68784e3f0cc0b85618826a9b3505129c16479973b0a84a4529e66b09c62"), + hex("0x1d359d245f286c12d50d663bae733f978af08cdbd63017c57b3a75646ff382c1"), + }, + { + hex("0x2a75a171563b807db525be259699ab28fe9bc7fb1f70943ff049bc970e841a0c"), + hex("0x083abff5e10051f078e2827d092e1ae808b4dd3e15ccc3706f38ce4157b6770e"), + hex("0x1a5ad71bbbecd8a97dc49cfdbae303ad24d5c4741eab8b7568a9ff8253a1eb6f"), + hex("0x0d745fd00dd167fb86772133640f02ce945004a7bc2c59e8790f725c5d84f0af"), + }, + { + hex("0x2070679e798782ef592a52ca9cef820d497ad2eecbaa7e42f366b3e521c4ed42"), + hex("0x2e18c8570d20bf5df800739a53da75d906ece318cd224ab6b3a2be979e2d7eab"), + hex("0x0fa86f0f27e4d3dd7f3367ce86f684f1f2e4386d3e5b9f38fa283c6aa723b608"), + hex("0x03f3e6fab791f16628168e4b14dbaeb657035ee3da6b2ca83f0c2491e0b403eb"), + }, + { + hex("0x2f545e578202c9732488540e41f783b68ff0613fd79375f8ba8b3d30958e7677"), + hex("0x23810bf82877fc19bff7eefeae3faf4bb8104c32ba4cd701596a15623d01476e"), + hex("0x014fcd5eb0be6d5beeafc4944034cf321c068ef930f10be2207ed58d2a34cdd6"), + hex("0xc15fc3a1d5733dd835eae0823e377f8ba4a8b627627cc2bb661c25d20fb52a"), + }, +} + +var CONSTANTS_4 = [][]frontend.Variable{ + { + hex("0x19b849f69450b06848da1d39bd5e4a4302bb86744edc26238b0878e269ed23e5"), + hex("0x265ddfe127dd51bd7239347b758f0a1320eb2cc7450acc1dad47f80c8dcf34d6"), + hex("0x199750ec472f1809e0f66a545e1e51624108ac845015c2aa3dfc36bab497d8aa"), + hex("0x157ff3fe65ac7208110f06a5f74302b14d743ea25067f0ffd032f787c7f1cdf8"), + }, + { + hex("0x2e49c43c4569dd9c5fd35ac45fca33f10b15c590692f8beefe18f4896ac94902"), + hex("0x0e35fb89981890520d4aef2b6d6506c3cb2f0b6973c24fa82731345ffa2d1f1e"), + hex("0x251ad47cb15c4f1105f109ae5e944f1ba9d9e7806d667ffec6fe723002e0b996"), + hex("0x13da07dc64d428369873e97160234641f8beb56fdd05e5f3563fa39d9c22df4e"), + }, + { + hex("0x0c009b84e650e6d23dc00c7dccef7483a553939689d350cd46e7b89055fd4738"), + hex("0x011f16b1c63a854f01992e3956f42d8b04eb650c6d535eb0203dec74befdca06"), + hex("0x0ed69e5e383a688f209d9a561daa79612f3f78d0467ad45485df07093f367549"), + hex("0x04dba94a7b0ce9e221acad41472b6bbe3aec507f5eb3d33f463672264c9f789b"), + }, + { + hex("0x0a3f2637d840f3a16eb094271c9d237b6036757d4bb50bf7ce732ff1d4fa28e8"), + hex("0x259a666f129eea198f8a1c502fdb38fa39b1f075569564b6e54a485d1182323f"), + hex("0x28bf7459c9b2f4c6d8e7d06a4ee3a47f7745d4271038e5157a32fdf7ede0d6a1"), + hex("0x0a1ca941f057037526ea200f489be8d4c37c85bbcce6a2aeec91bd6941432447"), + }, + { + hex("0x0c6f8f958be0e93053d7fd4fc54512855535ed1539f051dcb43a26fd926361cf"), + hex("0x123106a93cd17578d426e8128ac9d90aa9e8a00708e296e084dd57e69caaf811"), + hex("0x26e1ba52ad9285d97dd3ab52f8e840085e8fa83ff1e8f1877b074867cd2dee75"), + hex("0x1cb55cad7bd133de18a64c5c47b9c97cbe4d8b7bf9e095864471537e6a4ae2c5"), + }, + { + hex("0x1dcd73e46acd8f8e0e2c7ce04bde7f6d2a53043d5060a41c7143f08e6e9055d0"), + hex("0x011003e32f6d9c66f5852f05474a4def0cda294a0eb4e9b9b12b9bb4512e5574"), + hex("0x2b1e809ac1d10ab29ad5f20d03a57dfebadfe5903f58bafed7c508dd2287ae8c"), + hex("0x2539de1785b735999fb4dac35ee17ed0ef995d05ab2fc5faeaa69ae87bcec0a5"), + }, + { + hex("0x0c246c5a2ef8ee0126497f222b3e0a0ef4e1c3d41c86d46e43982cb11d77951d"), + hex("0x192089c4974f68e95408148f7c0632edbb09e6a6ad1a1c2f3f0305f5d03b527b"), + hex("0x1eae0ad8ab68b2f06a0ee36eeb0d0c058529097d91096b756d8fdc2fb5a60d85"), + hex("0x179190e5d0e22179e46f8282872abc88db6e2fdc0dee99e69768bd98c5d06bfb"), + }, + { + hex("0x29bb9e2c9076732576e9a81c7ac4b83214528f7db00f31bf6cafe794a9b3cd1c"), + hex("0x225d394e42207599403efd0c2464a90d52652645882aac35b10e590e6e691e08"), + hex("0x064760623c25c8cf753d238055b444532be13557451c087de09efd454b23fd59"), + hex("0x10ba3a0e01df92e87f301c4b716d8a394d67f4bf42a75c10922910a78f6b5b87"), + }, + { + hex("0x0e070bf53f8451b24f9c6e96b0c2a801cb511bc0c242eb9d361b77693f21471c"), + hex("0x1b94cd61b051b04dd39755ff93821a73ccd6cb11d2491d8aa7f921014de252fb"), + hex("0x1d7cb39bafb8c744e148787a2e70230f9d4e917d5713bb050487b5aa7d74070b"), + hex("0x2ec93189bd1ab4f69117d0fe980c80ff8785c2961829f701bb74ac1f303b17db"), + }, + { + hex("0x2db366bfdd36d277a692bb825b86275beac404a19ae07a9082ea46bd83517926"), + hex("0x062100eb485db06269655cf186a68532985275428450359adc99cec6960711b8"), + hex("0x0761d33c66614aaa570e7f1e8244ca1120243f92fa59e4f900c567bf41f5a59b"), + hex("0x20fc411a114d13992c2705aa034e3f315d78608a0f7de4ccf7a72e494855ad0d"), + }, + { + hex("0x25b5c004a4bdfcb5add9ec4e9ab219ba102c67e8b3effb5fc3a30f317250bc5a"), + hex("0x23b1822d278ed632a494e58f6df6f5ed038b186d8474155ad87e7dff62b37f4b"), + hex("0x22734b4c5c3f9493606c4ba9012499bf0f14d13bfcfcccaa16102a29cc2f69e0"), + hex("0x26c0c8fe09eb30b7e27a74dc33492347e5bdff409aa3610254413d3fad795ce5"), + }, + { + hex("0x070dd0ccb6bd7bbae88eac03fa1fbb26196be3083a809829bbd626df348ccad9"), + hex("0x12b6595bdb329b6fb043ba78bb28c3bec2c0a6de46d8c5ad6067c4ebfd4250da"), + hex("0x248d97d7f76283d63bec30e7a5876c11c06fca9b275c671c5e33d95bb7e8d729"), + hex("0x1a306d439d463b0816fc6fd64cc939318b45eb759ddde4aa106d15d9bd9baaaa"), + }, + { + hex("0x28a8f8372e3c38daced7c00421cb4621f4f1b54ddc27821b0d62d3d6ec7c56cf"), + hex("0x0094975717f9a8a8bb35152f24d43294071ce320c829f388bc852183e1e2ce7e"), + hex("0x04d5ee4c3aa78f7d80fde60d716480d3593f74d4f653ae83f4103246db2e8d65"), + hex("0x2a6cf5e9aa03d4336349ad6fb8ed2269c7bef54b8822cc76d08495c12efde187"), + }, + { + hex("0x2304d31eaab960ba9274da43e19ddeb7f792180808fd6e43baae48d7efcba3f3"), + hex("0x03fd9ac865a4b2a6d5e7009785817249bff08a7e0726fcb4e1c11d39d199f0b0"), + hex("0x00b7258ded52bbda2248404d55ee5044798afc3a209193073f7954d4d63b0b64"), + hex("0x159f81ada0771799ec38fca2d4bf65ebb13d3a74f3298db36272c5ca65e92d9a"), + }, + { + hex("0x1ef90e67437fbc8550237a75bc28e3bb9000130ea25f0c5471e144cf4264431f"), + hex("0x1e65f838515e5ff0196b49aa41a2d2568df739bc176b08ec95a79ed82932e30d"), + hex("0x2b1b045def3a166cec6ce768d079ba74b18c844e570e1f826575c1068c94c33f"), + hex("0x0832e5753ceb0ff6402543b1109229c165dc2d73bef715e3f1c6e07c168bb173"), + }, + { + hex("0x02f614e9cedfb3dc6b762ae0a37d41bab1b841c2e8b6451bc5a8e3c390b6ad16"), + hex("0x0e2427d38bd46a60dd640b8e362cad967370ebb777bedff40f6a0be27e7ed705"), + hex("0x0493630b7c670b6deb7c84d414e7ce79049f0ec098c3c7c50768bbe29214a53a"), + hex("0x22ead100e8e482674decdab17066c5a26bb1515355d5461a3dc06cc85327cea9"), + }, + { + hex("0x25b3e56e655b42cdaae2626ed2554d48583f1ae35626d04de5084e0b6d2a6f16"), + hex("0x1e32752ada8836ef5837a6cde8ff13dbb599c336349e4c584b4fdc0a0cf6f9d0"), + hex("0x2fa2a871c15a387cc50f68f6f3c3455b23c00995f05078f672a9864074d412e5"), + hex("0x2f569b8a9a4424c9278e1db7311e889f54ccbf10661bab7fcd18e7c7a7d83505"), + }, + { + hex("0x044cb455110a8fdd531ade530234c518a7df93f7332ffd2144165374b246b43d"), + hex("0x227808de93906d5d420246157f2e42b191fe8c90adfe118178ddc723a5319025"), + hex("0x02fcca2934e046bc623adead873579865d03781ae090ad4a8579d2e7a6800355"), + hex("0x0ef915f0ac120b876abccceb344a1d36bad3f3c5ab91a8ddcbec2e060d8befac"), + }, + { + hex("0x1797130f4b7a3e1777eb757bc6f287f6ab0fb85f6be63b09f3b16ef2b1405d38"), + hex("0x0a76225dc04170ae3306c85abab59e608c7f497c20156d4d36c668555decc6e5"), + hex("0x1fffb9ec1992d66ba1e77a7b93209af6f8fa76d48acb664796174b5326a31a5c"), + hex("0x25721c4fc15a3f2853b57c338fa538d85f8fbba6c6b9c6090611889b797b9c5f"), + }, + { + hex("0x0c817fd42d5f7a41215e3d07ba197216adb4c3790705da95eb63b982bfcaf75a"), + hex("0x13abe3f5239915d39f7e13c2c24970b6df8cf86ce00a22002bc15866e52b5a96"), + hex("0x2106feea546224ea12ef7f39987a46c85c1bc3dc29bdbd7a92cd60acb4d391ce"), + hex("0x21ca859468a746b6aaa79474a37dab49f1ca5a28c748bc7157e1b3345bb0f959"), + }, + { + hex("0x05ccd6255c1e6f0c5cf1f0df934194c62911d14d0321662a8f1a48999e34185b"), + hex("0x0f0e34a64b70a626e464d846674c4c8816c4fb267fe44fe6ea28678cb09490a4"), + hex("0x0558531a4e25470c6157794ca36d0e9647dbfcfe350d64838f5b1a8a2de0d4bf"), + hex("0x09d3dca9173ed2faceea125157683d18924cadad3f655a60b72f5864961f1455"), + }, + { + hex("0x0328cbd54e8c0913493f866ed03d218bf23f92d68aaec48617d4c722e5bd4335"), + hex("0x2bf07216e2aff0a223a487b1a7094e07e79e7bcc9798c648ee3347dd5329d34b"), + hex("0x1daf345a58006b736499c583cb76c316d6f78ed6a6dffc82111e11a63fe412df"), + hex("0x176563472456aaa746b694c60e1823611ef39039b2edc7ff391e6f2293d2c404"), + }, + { + hex("0x2ef1e0fad9f08e87a3bb5e47d7e33538ca964d2b7d1083d4fb0225035bd3f8db"), + hex("0x226c9b1af95babcf17b2b1f57c7310179c1803dec5ae8f0a1779ed36c817ae2a"), + hex("0x14bce3549cc3db7428126b4c3a15ae0ff8148c89f13fb35d35734eb5d4ad0def"), + hex("0x2debff156e276bb5742c3373f2635b48b8e923d301f372f8e550cfd4034212c7"), + }, + { + hex("0x2d4083cf5a87f5b6fc2395b22e356b6441afe1b6b29c47add7d0432d1d4760c7"), + hex("0x0c225b7bcd04bf9c34b911262fdc9c1b91bf79a10c0184d89c317c53d7161c29"), + hex("0x03152169d4f3d06ec33a79bfac91a02c99aa0200db66d5aa7b835265f9c9c8f3"), + hex("0x0b61811a9210be78b05974587486d58bddc8f51bfdfebbb87afe8b7aa7d3199c"), + }, + { + hex("0x203e000cad298daaf7eba6a5c5921878b8ae48acf7048f16046d637a533b6f78"), + hex("0x1a44bf0937c722d1376672b69f6c9655ba7ee386fda1112c0757143d1bfa9146"), + hex("0x0376b4fae08cb03d3500afec1a1f56acb8e0fde75a2106d7002f59c5611d4daa"), + hex("0x00780af2ca1cad6465a2171250fdfc32d6fc241d3214177f3d553ef363182185"), + }, + { + hex("0x10774d9ab80c25bdeb808bedfd72a8d9b75dbe18d5221c87e9d857079bdc31d5"), + hex("0x10dc6e9c006ea38b04b1e03b4bd9490c0d03f98929ca1d7fb56821fd19d3b6e8"), + hex("0x00544b8338791518b2c7645a50392798b21f75bb60e3596170067d00141cac16"), + hex("0x222c01175718386f2e2e82eb122789e352e105a3b8fa852613bc534433ee428c"), + }, + { + hex("0x2840d045e9bc22b259cfb8811b1e0f45b77f7bdb7f7e2b46151a1430f608e3c5"), + hex("0x062752f86eebe11a009c937e468c335b04554574c2990196508e01fa5860186b"), + hex("0x06041bdac48205ac87adb87c20a478a71c9950c12a80bc0a55a8e83eaaf04746"), + hex("0x04a533f236c422d1ff900a368949b0022c7a2ae092f308d82b1dcbbf51f5000d"), + }, + { + hex("0x13e31d7a67232fd811d6a955b3d4f25dfe066d1e7dc33df04bde50a2b2d05b2a"), + hex("0x011c2683ae91eb4dfbc13d6357e8599a9279d1648ff2c95d2f79905bb13920f1"), + hex("0x0b0d219346b8574525b1a270e0b4cba5d56c928e3e2c2bd0a1ecaed015aaf6ae"), + hex("0x14abdec8db9c6dc970291ee638690209b65080781ef9fd13d84c7a726b5f1364"), + }, + { + hex("0x1a0b70b4b26fdc28fcd32aa3d266478801eb12202ef47ced988d0376610be106"), + hex("0x278543721f96d1307b6943f9804e7fe56401deb2ef99c4d12704882e7278b607"), + hex("0x16eb59494a9776cf57866214dbd1473f3f0738a325638d8ba36535e011d58259"), + hex("0x2567a658a81ffb444f240088fa5524c69a9e53eeab6b7f8c41c3479dcf8c644a"), + }, + { + hex("0x29aa1d7c151e9ad0a7ab39f1abd9cf77ab78e0215a5715a6b882ade840bb13d8"), + hex("0x15c091233e60efe0d4bbfce2b36415006a4f017f9a85388ce206b91f99f2c984"), + hex("0x16bd7d22ff858e5e0882c2c999558d77e7673ad5f1915f9feb679a8115f014cf"), + hex("0x02db50480a07be0eb2c2e13ed6ef4074c0182d9b668b8e08ffe6769250042025"), + }, + { + hex("0x05e4a220e6a3bc9f7b6806ec9d6cdba186330ef2bf7adb4c13ba866343b73119"), + hex("0x1dda05ebc30170bc98cbf2a5ee3b50e8b5f70bc424d39fa4104d37f1cbcf7a42"), + hex("0x0184bef721888187f645b6fee3667f3c91da214414d89ba5cd301f22b0de8990"), + hex("0x1498a307e68900065f5e8276f62aef1c37414b84494e1577ad1a6d64341b78ec"), + }, + { + hex("0x25f40f82b31dacc4f4939800b9d2c3eacef737b8fab1f864fe33548ad46bd49d"), + hex("0x09d317cc670251943f6f5862a30d2ea9e83056ce4907bfbbcb1ff31ce5bb9650"), + hex("0x2f77d77786d979b23ba4ce4a4c1b3bd0a41132cd467a86ab29b913b6cf3149d0"), + hex("0x0f53dafd535a9f4473dc266b6fccc6841bbd336963f254c152f89e785f729bbf"), + }, + { + hex("0x25c1fd72e223045265c3a099e17526fa0e6976e1c00baf16de96de85deef2fa2"), + hex("0x2a902c8980c17faae368d385d52d16be41af95c84eaea3cf893e65d6ce4a8f62"), + hex("0x1ce1580a3452ecf302878c8976b82be96676dd114d1dc8d25527405762f83529"), + hex("0x24a6073f91addc33a49a1fa306df008801c5ec569609034d2fc50f7f0f4d0056"), + }, + { + hex("0x25e52dbd6124530d9fc27fe306d71d4583e07ca554b5d1577f256c68b0be2b74"), + hex("0x23dffae3c423fa7a93468dbccfb029855974be4d0a7b29946796e5b6cd70f15d"), + hex("0x06342da370cc0d8c49b77594f6b027c480615d50be36243a99591bc9924ed6f5"), + hex("0x2754114281286546b75f09f115fc751b4778303d0405c1b4cc7df0d8e9f63925"), + }, + { + hex("0x15c19e8534c5c1a8862c2bc1d119eddeabf214153833d7bdb59ee197f8187cf5"), + hex("0x265fe062766d08fab4c78d0d9ef3cabe366f3be0a821061679b4b3d2d77d5f3e"), + hex("0x13ccf689d67a3ec9f22cb7cd0ac3a327d377ac5cd0146f048debfd098d3ec7be"), + hex("0x17662f7456789739f81cd3974827a887d92a5e05bdf3fe6b9fbccca4524aaebd"), + }, + { + hex("0x21b29c76329b31c8ef18631e515f7f2f82ca6a5cca70cee4e809fd624be7ad5d"), + hex("0x18137478382aadba441eb97fe27901989c06738165215319939eb17b01fa975c"), + hex("0x2bc07ea2bfad68e8dc724f5fef2b37c2d34f761935ffd3b739ceec4668f37e88"), + hex("0x2ddb2e376f54d64a563840480df993feb4173203c2bd94ad0e602077aef9a03e"), + }, + { + hex("0x277eb50f2baa706106b41cb24c602609e8a20f8d72f613708adb25373596c3f7"), + hex("0x0d4de47e1aba34269d0c620904f01a56b33fc4b450c0db50bb7f87734c9a1fe5"), + hex("0x0b8442bfe9e4a1b4428673b6bd3eea6f9f445697058f134aae908d0279a29f0c"), + hex("0x11fe5b18fbbea1a86e06930cb89f7d4a26e186a65945e96574247fddb720f8f5"), + }, + { + hex("0x224026f6dfaf71e24d25d8f6d9f90021df5b774dcad4d883170e4ad89c33a0d6"), + hex("0x0b2ca6a999fe6887e0704dad58d03465a96bc9e37d1091f61bc9f9c62bbeb824"), + hex("0x221b63d66f0b45f9d40c54053a28a06b1d0a4ce41d364797a1a7e0c96529f421"), + hex("0x30185c48b7b2f1d53d4120801b047d087493bce64d4d24aedce2f4836bb84ad4"), + }, + { + hex("0x23f5d372a3f0e3cba989e223056227d3533356f0faa48f27f8267318632a61f0"), + hex("0x2716683b32c755fd1bf8235ea162b1f388e1e0090d06162e8e6dfbe4328f3e3b"), + hex("0x0977545836866fa204ca1d853ec0909e3d140770c80ac67dc930c69748d5d4bc"), + hex("0x1444e8f592bdbfd8025d91ab4982dd425f51682d31472b05e81c43c0f9434b31"), + }, + { + hex("0x26e04b65e9ca8270beb74a1c5cb8fee8be3ffbfe583f7012a00f874e7718fbe3"), + hex("0x22a5c2fa860d11fe34ee47a5cd9f869800f48f4febe29ad6df69816fb1a914d2"), + hex("0x174b54d9907d8f5c6afd672a738f42737ec338f3a0964c629f7474dd44c5c8d7"), + hex("0x1db1db8aa45283f31168fa66694cf2808d2189b87c8c8143d56c871907b39b87"), + }, + { + hex("0x1530bf0f46527e889030b8c7b7dfde126f65faf8cce0ab66387341d813d1bfd1"), + hex("0x0b73f613993229f59f01c1cec8760e9936ead9edc8f2814889330a2f2bade457"), + hex("0x29c25a22fe2164604552aaea377f448d587ab977fc8227787bd2dc0f36bcf41e"), + hex("0x2b30d53ed1759bfb8503da66c92cf4077abe82795dc272b377df57d77c875526"), + }, + { + hex("0x12f6d703b5702aab7b7b7e69359d53a2756c08c85ede7227cf5f0a2916787cd2"), + hex("0x2520e18300afda3f61a40a0b8837293a55ad01071028d4841ffa9ac706364113"), + hex("0x1ec9daea860971ecdda8ed4f346fa967ac9bc59278277393c68f09fa03b8b95f"), + hex("0x0a99b3e178db2e2e432f5cd5bef8fe4483bf5cbf70ed407c08aae24b830ad725"), + }, + { + hex("0x07cda9e63db6e39f086b89b601c2bbe407ee0abac3c817a1317abad7c5778492"), + hex("0x08c9c65a4f955e8952d571b191bb0adb49bd8290963203b35d48aab38f8fc3a3"), + hex("0x2737f8ce1d5a67b349590ddbfbd709ed9af54a2a3f2719d33801c9c17bdd9c9e"), + hex("0x1049a6c65ff019f0d28770072798e8b7909432bd0c129813a9f179ba627f7d6a"), + }, + { + hex("0x18b4fe968732c462c0ea5a9beb27cecbde8868944fdf64ee60a5122361daeddb"), + hex("0x2ff2b6fd22df49d2440b2eaeeefa8c02a6f478cfcf11f1b2a4f7473483885d19"), + hex("0x2ec5f2f1928fe932e56c789b8f6bbcb3e8be4057cbd8dbd18a1b352f5cef42ff"), + hex("0x265a5eccd8b92975e33ad9f75bf3426d424a4c6a7794ee3f08c1d100378e545e"), + }, + { + hex("0x2405eaa4c0bde1129d6242bb5ada0e68778e656cfcb366bf20517da1dfd4279c"), + hex("0x094c97d8c194c42e88018004cbbf2bc5fdb51955d8b2d66b76dd98a2dbf60417"), + hex("0x2c30d5f33bb32c5c22b9979a605bf64d508b705221e6a686330c9625c2afe0b8"), + hex("0x01a75666f6241f6825d01cc6dcb1622d4886ea583e87299e6aa2fc716fdb6cf5"), + }, + { + hex("0x0a3290e8398113ea4d12ac091e87be7c6d359ab9a66979fcf47bf2e87d382fcb"), + hex("0x154ade9ca36e268dfeb38461425bb0d8c31219d8fa0dfc75ecd21bf69aa0cc74"), + hex("0x27aa8d3e25380c0b1b172d79c6f22eee99231ef5dc69d8dc13a4b5095d028772"), + hex("0x2cf4051e6cab48301a8b2e3bca6099d756bbdf485afa1f549d395bbcbd806461"), + }, + { + hex("0x301e70f729f3c94b1d3f517ddff9f2015131feab8afa5eebb0843d7f84b23e71"), + hex("0x298beb64f812d25d8b4d9620347ab02332dc4cef113ae60d17a8d7a4c91f83bc"), + hex("0x1b362e72a5f847f84d03fd291c3c471ed1c14a15b221680acf11a3f02e46aa95"), + hex("0x0dc8a2146110c0b375432902999223d5aa1ef6e78e1e5ebcbc1d9ba41dc1c737"), + }, + { + hex("0x0a48663b34ce5e1c05dc93092cb69778cb21729a72ddc03a08afa1eb922ff279"), + hex("0x0a87391fb1cd8cdf6096b64a82f9e95f0fe46f143b702d74545bb314881098ee"), + hex("0x1b5b2946f7c28975f0512ff8e6ca362f8826edd7ea9c29f382ba8a2a0892fd5d"), + hex("0x01001cf512ac241d47ebe2239219bc6a173a8bbcb8a5b987b4eac1f533315b6b"), + }, + { + hex("0x2fd977c70f645db4f704fa7d7693da727ac093d3fb5f5febc72beb17d8358a32"), + hex("0x23c0039a3fab4ad3c2d7cc688164f39e761d5355c05444d99be763a97793a9c4"), + hex("0x19d43ee0c6081c052c9c0df6161eaac1aec356cf435888e79f27f22ff03fa25d"), + hex("0x2d9b10c2f2e7ac1afddccffd94a563028bf29b646d020830919f9d5ca1cefe59"), + }, + { + hex("0x2457ca6c2f2aa30ec47e4aff5a66f5ce2799283e166fc81cdae2f2b9f83e4267"), + hex("0x0abc392fe85eda855820592445094022811ee8676ed6f0c3044dfb54a7c10b35"), + hex("0x19d2cc5ca549d1d40cebcd37f3ea54f31161ac3993acf3101d2c2bc30eac1eb0"), + hex("0x0f97ae3033ffa01608aafb26ae13cd393ee0e4ec041ba644a3d3ab546e98c9c8"), + }, + { + hex("0x16dbc78fd28b7fb8260e404cf1d427a7fa15537ea4e168e88a166496e88cfeca"), + hex("0x240faf28f11499b916f085f73bc4f22eef8344e576f8ad3d1827820366d5e07b"), + hex("0x0a1bb075aa37ff0cfe6c8531e55e1770eaba808c8fdb6dbf46f8cab58d9ef1af"), + hex("0x2e47e15ea4a47ff1a6a853aaf3a644ca38d5b085ac1042fdc4a705a7ce089f4d"), + }, + { + hex("0x166e5bf073378348860ca4a9c09d39e1673ab059935f4df35fb14528375772b6"), + hex("0x18b42d7ffdd2ea4faf235902f057a2740cacccd027233001ed10f96538f0916f"), + hex("0x089cb1b032238f5e4914788e3e3c7ead4fc368020b3ed38221deab1051c37702"), + hex("0x242acd3eb3a2f72baf7c7076dd165adf89f9339c7b971921d9e70863451dd8d1"), + }, + { + hex("0x174fbb104a4ee302bf47f2bd82fce896eac9a068283f326474af860457245c3b"), + hex("0x17340e71d96f466d61f3058ce092c67d2891fb2bb318613f780c275fe1116c6b"), + hex("0x1e8e40ac853b7d42f00f2e383982d024f098b9f8fd455953a2fd380c4df7f6b2"), + hex("0x0529898dc0649907e1d4d5e284b8d1075198c55cad66e8a9bf40f92938e2e961"), + }, + { + hex("0x2162754db0baa030bf7de5bb797364dce8c77aa017ee1d7bf65f21c4d4e5df8f"), + hex("0x12c7553698c4bf6f3ceb250ae00c58c2a9f9291efbde4c8421bef44741752ec6"), + hex("0x292643e3ba2026affcb8c5279313bd51a733c93353e9d9c79cb723136526508e"), + hex("0x00ccf13e0cb6f9d81d52951bea990bd5b6c07c5d98e66ff71db6e74d5b87d158"), + }, + { + hex("0x185d1e20e23b0917dd654128cf2f3aaab6723873cb30fc22b0f86c15ab645b4b"), + hex("0x14c61c836d55d3df742bdf11c60efa186778e3de0f024c0f13fe53f8d8764e1f"), + hex("0x0f356841b3f556fce5dbe4680457691c2919e2af53008184d03ee1195d72449e"), + hex("0x1b8fd9ff39714e075df124f887bf40b383143374fd2080ba0c0a6b6e8fa5b3e8"), + }, + { + hex("0x0e86a8c2009c140ca3f873924e2aaa14fc3c8ae04e9df0b3e9103418796f6024"), + hex("0x2e6c5e898f5547770e5462ad932fcdd2373fc43820ca2b16b0861421e79155c8"), + hex("0x05d797f1ab3647237c14f9d1df032bc9ff9fe1a0ecd377972ce5fd5a0c014604"), + hex("0x29a3110463a5aae76c3d152875981d0c1daf2dcd65519ef5ca8929851da8c008"), + }, + { + hex("0x2974da7bc074322273c3a4b91c05354cdc71640a8bbd1f864b732f8163883314"), + hex("0x1ed0fb06699ba249b2a30621c05eb12ca29cb91aa082c8bfcce9c522889b47dc"), + hex("0x1c793ef0dcc51123654ff26d8d863feeae29e8c572eca912d80c8ae36e40fe9b"), + hex("0x1e6aac1c6d3dd3157956257d3d234ef18c91e82589a78169fbb4a8770977dc2f"), + }, + { + hex("0x1a20ada7576234eee6273dd6fa98b25ed037748080a47d948fcda33256fb6bf5"), + hex("0x191033d6d85ceaa6fc7a9a23a6fd9996642d772045ece51335d49306728af96c"), + hex("0x006e5979da7e7ef53a825aa6fddc3abfc76f200b3740b8b232ef481f5d06297b"), + hex("0x0b0d7e69c651910bbef3e68d417e9fa0fbd57f596c8f29831eff8c0174cdb06d"), + }, + { + hex("0x25caf5b0c1b93bc516435ec084e2ecd44ac46dbbb033c5112c4b20a25c9cdf9d"), + hex("0x12c1ea892cc31e0d9af8b796d9645872f7f77442d62fd4c8085b2f150f72472a"), + hex("0x16af29695157aba9b8bbe3afeb245feee5a929d9f928b9b81de6dadc78c32aae"), + hex("0x0136df457c80588dd687fb2f3be18691705b87ec5a4cfdc168d31084256b67dc"), + }, + { + hex("0x1639a28c5b4c81166aea984fba6e71479e07b1efbc74434db95a285060e7b089"), + hex("0x03d62fbf82fd1d4313f8e650f587ec06816c28b700bdc50f7e232bd9b5ca9b76"), + hex("0x11aeeb527dc8ce44b4d14aaddca3cfe2f77a1e40fc6da97c249830de1edfde54"), + hex("0x13f9b9a41274129479c5e6138c6c8ee36a670e6bc68c7a49642b645807bfc824"), + }, + { + hex("0x0e4772fa3d75179dc8484cd26c7c1f635ddeeed7a939440c506cae8b7ebcd15b"), + hex("0x1b39a00cbc81e427de4bdec58febe8d8b5971752067a612b39fc46a68c5d4db4"), + hex("0x2bedb66e1ad5a1d571e16e2953f48731f66463c2eb54a245444d1c0a3a25707e"), + hex("0x2cf0a09a55ca93af8abd068f06a7287fb08b193b608582a27379ce35da915dec"), + }, + { + hex("0x2d1bd78fa90e77aa88830cabfef2f8d27d1a512050ba7db0753c8fb863efb387"), + hex("0x065610c6f4f92491f423d3071eb83539f7c0d49c1387062e630d7fd283dc3394"), + hex("0x2d933ff19217a5545013b12873452bebcc5f9969033f15ec642fb464bd607368"), + hex("0x1aa9d3fe4c644910f76b92b3e13b30d500dae5354e79508c3c49c8aa99e0258b"), + }, + { + hex("0x027ef04869e482b1c748638c59111c6b27095fa773e1aca078cea1f1c8450bdd"), + hex("0x2b7d524c5172cbbb15db4e00668a8c449f67a2605d9ec03802e3fa136ad0b8fb"), + hex("0x0c7c382443c6aa787c8718d86747c7f74693ae25b1e55df13f7c3c1dd735db0f"), + hex("0x00b4567186bc3f7c62a7b56acf4f76207a1f43c2d30d0fe4a627dcdd9bd79078"), + }, + { + hex("0x1e41fc29b825454fe6d61737fe08b47fb07fe739e4c1e61d0337490883db4fd5"), + hex("0x12507cd556b7bbcc72ee6dafc616584421e1af872d8c0e89002ae8d3ba0653b6"), + hex("0x13d437083553006bcef312e5e6f52a5d97eb36617ef36fe4d77d3e97f71cb5db"), + hex("0x163ec73251f85443687222487dda9a65467d90b22f0b38664686077c6a4486d5"), + }, +} diff --git a/gnark-prover/prover/poseidon/poseidon.go b/gnark-prover/prover/poseidon/poseidon.go index 4485ade625..444ae91752 100644 --- a/gnark-prover/prover/poseidon/poseidon.go +++ b/gnark-prover/prover/poseidon/poseidon.go @@ -25,12 +25,21 @@ var CFG_3 = cfg{ mds: MDS_3, } +var CFG_4 = cfg{ + RF: 8, + RP: 56, + constants: CONSTANTS_4, + mds: MDS_4, +} + func cfgFor(t int) *cfg { switch t { case 2: return &CFG_2 case 3: return &CFG_3 + case 4: + return &CFG_4 } panic("Poseidon: unsupported arg count") } @@ -135,5 +144,6 @@ func (h fullRound) DefineGadget(api frontend.API) interface{} { for i := 0; i < len(h.Inp); i += 1 { h.Inp[i] = abstractor.Call(api, sbox{h.Inp[i]}) } - return abstractor.Call1(api, mds{h.Inp}) + result := abstractor.Call1(api, mds{h.Inp}) + return result } diff --git a/gnark-prover/prover/poseidon/poseidon_test.go b/gnark-prover/prover/poseidon/poseidon_test.go index 07ac028a88..0ba3fc60be 100644 --- a/gnark-prover/prover/poseidon/poseidon_test.go +++ b/gnark-prover/prover/poseidon/poseidon_test.go @@ -46,10 +46,11 @@ func (circuit *TestPoseidonCircuit3) Define(api frontend.API) error { return nil } -func TestPoseidon(t *testing.T) { +func TestPoseidon1(t *testing.T) { assert := test.NewAssert(t) var circuit1 TestPoseidonCircuit1 + assert.ProverSucceeded(&circuit1, &TestPoseidonCircuit1{ Input: 0, Hash: hex("0x2a09a9fd93c590c26b91effbb2499f07e8f7aa12e2b4940a3aed2411cb65e11c"), @@ -64,6 +65,10 @@ func TestPoseidon(t *testing.T) { Input: 2, Hash: hex("0x131d73cf6b30079aca0dff6a561cd0ee50b540879abe379a25a06b24bde2bebd"), }, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254)) +} + +func TestPoseidon2(t *testing.T) { + assert := test.NewAssert(t) var circuit2 TestPoseidonCircuit2 @@ -98,3 +103,37 @@ func TestPoseidon(t *testing.T) { }, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254)) } + +func TestPoseidon3(t *testing.T) { + assert := test.NewAssert(t) + + var circuit3 TestPoseidonCircuit3 + + assert.ProverSucceeded(&circuit3, &TestPoseidonCircuit3{ + First: 123, + Second: 456, + Third: 789, + Hash: hex("0x15bf2dbca201b7b45f1ae01c1c1ac0eee26854c01758b9df14a319959c50155f"), + }, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254)) + + assert.ProverSucceeded(&circuit3, &TestPoseidonCircuit3{ + First: 1, + Second: 1, + Third: 1, + Hash: hex("0x2c0066e10a72abd2b33c3b214cb3e81bcb1b6e30961cd23c202b18673bf2543"), + }, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254)) + + assert.ProverSucceeded(&circuit3, &TestPoseidonCircuit3{ + First: 1, + Second: 2, + Third: 3, + Hash: hex("0xe7732d89e6939c0ff03d5e58dab6302f3230e269dc5b968f725df34ab36d732"), + }, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254)) + + assert.ProverSucceeded(&circuit3, &TestPoseidonCircuit3{ + First: 1, + Second: 2, + Third: 3, + Hash: hex("0xe7732d89e6939c0ff03d5e58dab6302f3230e269dc5b968f725df34ab36d732"), + }, test.WithBackends(backend.GROTH16), test.WithCurves(ecc.BN254)) +} diff --git a/gnark-prover/server/server.go b/gnark-prover/server/server.go index cee7abc8a3..6cf63ff9fd 100644 --- a/gnark-prover/server/server.go +++ b/gnark-prover/server/server.go @@ -80,7 +80,9 @@ func Run(config *Config, provingSystem []*prover.ProvingSystem) RunningJob { logging.Logger().Info().Str("addr", config.MetricsAddress).Msg("metrics server started") proverMux := http.NewServeMux() - proverMux.Handle("/inclusion", proveHandler{provingSystem: provingSystem}) + proverMux.Handle("/inclusion", proveHandler{provingSystem: provingSystem, inclusion: true}) + proverMux.Handle("/noninclusion", proveHandler{provingSystem: provingSystem, inclusion: false}) + proverMux.Handle("/health", healthHandler{}) proverServer := &http.Server{Addr: config.ProverAddress, Handler: proverMux} proverJob := spawnServerJob(proverServer, "prover server") @@ -91,6 +93,7 @@ func Run(config *Config, provingSystem []*prover.ProvingSystem) RunningJob { type proveHandler struct { provingSystem []*prover.ProvingSystem + inclusion bool } type healthHandler struct { @@ -112,45 +115,67 @@ func (handler proveHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { var proof *prover.Proof - var params prover.InclusionParameters + if handler.inclusion { + var params prover.InclusionParameters - err = json.Unmarshal(buf, ¶ms) - if err != nil { - logging.Logger().Info().Msg("error Unmarshal") - logging.Logger().Info().Msg(err.Error()) - malformedBodyError(err).send(w) - return - } + err = json.Unmarshal(buf, ¶ms) + if err != nil { + logging.Logger().Info().Msg("error Unmarshal") + logging.Logger().Info().Msg(err.Error()) + malformedBodyError(err).send(w) + return + } - var numberOfUtxos = uint32(len(params.Root)) + var numberOfUtxos = uint32(len(params.Root)) - var ps *prover.ProvingSystem - for _, provingSystem := range handler.provingSystem { - if provingSystem.Inclusion && provingSystem.NumberOfUtxos == numberOfUtxos { - ps = provingSystem - break + var ps *prover.ProvingSystem + for _, provingSystem := range handler.provingSystem { + if provingSystem.Inclusion && provingSystem.NumberOfUtxos == numberOfUtxos { + ps = provingSystem + break + } } - } - if ps == nil { - logging.Logger().Info().Msg(fmt.Sprintf("no proving system for %d utxos", numberOfUtxos)) - provingError(fmt.Errorf("no proving system for %d utxos", numberOfUtxos)).send(w) - return - } + if ps == nil { + logging.Logger().Info().Msg(fmt.Sprintf("no proving system for %d utxos", numberOfUtxos)) + provingError(fmt.Errorf("no proving system for %d utxos", numberOfUtxos)).send(w) + return + } - proof, err = ps.ProveInclusion(¶ms) + proof, err = ps.ProveInclusion(¶ms) + } else { + var params prover.NonInclusionParameters + err = json.Unmarshal(buf, ¶ms) + if err != nil { + malformedBodyError(err).send(w) + return + } + + var numberOfUtxos = uint32(len(params.Root)) + var ps *prover.ProvingSystem + for _, provingSystem := range handler.provingSystem { + if !provingSystem.Inclusion && provingSystem.NumberOfUtxos == numberOfUtxos { + ps = provingSystem + break + } + } + + if ps == nil { + provingError(fmt.Errorf("no proving system for %d utxos", numberOfUtxos)).send(w) + return + } + proof, err = ps.ProveNonInclusion(¶ms) + } if err != nil { - logging.Logger().Info().Msg("error ProveInclusion") - logging.Logger().Info().Msg(err.Error()) + logging.Logger().Err(err) provingError(err).send(w) return } responseBytes, err := json.Marshal(&proof) if err != nil { - logging.Logger().Info().Msg("Error marshal response bytes") - logging.Logger().Info().Msg(err.Error()) + logging.Logger().Err(err) unexpectedError(err).send(w) return } @@ -159,8 +184,7 @@ func (handler proveHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { _, err = w.Write(responseBytes) if err != nil { - logging.Logger().Error().Err(err).Msg("error writing response") - logging.Logger().Info().Msg(err.Error()) + logging.Logger().Err(err) } } diff --git a/gnark-prover/test-data/non_inclusion.csv b/gnark-prover/test-data/non_inclusion.csv new file mode 100644 index 0000000000..e85ce0c01d --- /dev/null +++ b/gnark-prover/test-data/non_inclusion.csv @@ -0,0 +1 @@ +1; {"root":["0x25a5c4f28064c652bb113742eedc9d1c8b5beb96d633ff4fde5e584a6534f4ec"],"value":["0x2"],"leafLowerRangeValue":["0x1"],"leafHigherRangeValue":["0x3"],"leafIndex":[2],"inPathElements":[["0x1870293e9c4572d377d13ee4d3a10bd0aadc2b2804e159a088b5b066e2afa305","0x2aeda0b6795f709a521e3ca32c7d865d64d58d100b2ac064a91a2e638354695e","0x1069673dcdb12263df301a6ff584a7ec261a44cb9dc68df067a4774460b1f1e1","0x18f43331537ee2af2e3d758d50f72106467c6eea50371dd528d57eb2b856d238","0x07f9d837cb17b0d36320ffe93ba52345f1b728571a568265caac97559dbc952a","0x2b94cf5e8746b3f5c9631f4c5df32907a699c58c94b2ad4d7b5cec1639183f55","0x2dee93c5a666459646ea7d22cca9e1bcfed71e6951b953611d11dda32ea09d78","0x078295e5a22b84e982cf601eb639597b8b0515a88cb5ac7fa8a4aabe3c87349d","0x2fa5e5f18f6027a6501bec864564472a616b2e274a41211a444cbe3a99f3cc61","0x0e884376d0d8fd21ecb780389e941f66e45e7acce3e228ab3e2156a614fcd747","0x1b7201da72494f1e28717ad1a52eb469f95892f957713533de6175e5da190af2","0x1f8d8822725e36385200c0b201249819a6e6e1e4650808b5bebc6bface7d7636","0x2c5d82f66c914bafb9701589ba8cfcfb6162b0a12acf88a8d0879a0471b5f85a","0x14c54148a0940bb820957f5adf3fa1134ef5c4aaa113f4646458f270e0bfbfd0","0x190d33b12f986f961e10c0ee44d8b9af11be25588cad89d416118e4bf4ebe80c","0x22f98aa9ce704152ac17354914ad73ed1167ae6596af510aa5b3649325e06c92","0x2a7c7c9b6ce5880b9f6f228d72bf6a575a526f29c66ecceef8b753d38bba7323","0x2e8186e558698ec1c67af9c14d463ffc470043c9c2988b954d75dd643f36b992","0x0f57c5571e9a4eab49e2c8cf050dae948aef6ead647392273546249d1c1ff10f","0x1830ee67b5fb554ad5f63d4388800e1cfe78e310697d46e43c9ce36134f72cca","0x2134e76ac5d21aab186c2be1dd8f84ee880a1e46eaf712f9d371b6df22191f3e","0x19df90ec844ebc4ffeebd866f33859b0c051d8c958ee3aa88f8f8df3db91a5b1","0x18cca2a66b5c0787981e69aefd84852d74af0e93ef4912b4648c05f722efe52b","0x2388909415230d1b4d1304d2d54f473a628338f2efad83fadf05644549d2538d","0x27171fb4a97b6cc0e9e8f543b5294de866a2af2c9c8d0b1d96e673e4529ed540","0x2ff6650540f629fd5711a0bc74fc0d28dcb230b9392583e5f8d59696dde6ae21"]],"inPathIndices":[1]} \ No newline at end of file diff --git a/hasher.rs/benches/blake.test.ts b/hasher.rs/benches/blake.test.ts index 46e8639b9b..2db898fde2 100644 --- a/hasher.rs/benches/blake.test.ts +++ b/hasher.rs/benches/blake.test.ts @@ -1,8 +1,6 @@ -import {blake2str, poseidon} from "light-wasm"; -import {BN} from "@coral-xyz/anchor"; import { blake2b } from "@noble/hashes/blake2b"; - import { Bench } from 'tinybench'; +import { blake2str } from "../src/main/wasm"; const bench = new Bench({ time: 1000 }); bench diff --git a/programs/compressed-pda/src/verifying_keys/non-inclusion_26_1.rs b/programs/compressed-pda/src/verifying_keys/non-inclusion_26_1.rs new file mode 100644 index 0000000000..553b077e8c --- /dev/null +++ b/programs/compressed-pda/src/verifying_keys/non-inclusion_26_1.rs @@ -0,0 +1,72 @@ +// This file is generated by xtask. Do not edit it manually. + +use groth16_solana::groth16::Groth16Verifyingkey; +pub const VERIFYINGKEY: Groth16Verifyingkey = Groth16Verifyingkey { + nr_pubinputs: 2usize, + vk_alpha_g1: [ + 22u8, 161u8, 238u8, 81u8, 92u8, 221u8, 216u8, 43u8, 71u8, 125u8, 196u8, 132u8, 231u8, + 235u8, 140u8, 8u8, 156u8, 16u8, 29u8, 74u8, 51u8, 30u8, 7u8, 17u8, 175u8, 145u8, 101u8, + 31u8, 15u8, 218u8, 76u8, 254u8, 25u8, 173u8, 170u8, 82u8, 174u8, 14u8, 201u8, 125u8, 160u8, + 90u8, 166u8, 129u8, 133u8, 182u8, 173u8, 89u8, 25u8, 189u8, 242u8, 38u8, 218u8, 207u8, + 26u8, 180u8, 193u8, 52u8, 226u8, 139u8, 159u8, 110u8, 182u8, 80u8, + ], + vk_beta_g2: [ + 24u8, 133u8, 156u8, 197u8, 243u8, 72u8, 56u8, 55u8, 79u8, 66u8, 159u8, 171u8, 119u8, 147u8, + 236u8, 117u8, 37u8, 168u8, 209u8, 66u8, 223u8, 98u8, 169u8, 78u8, 67u8, 255u8, 212u8, 25u8, + 147u8, 77u8, 109u8, 90u8, 4u8, 196u8, 174u8, 73u8, 54u8, 118u8, 37u8, 38u8, 50u8, 217u8, + 84u8, 40u8, 131u8, 207u8, 10u8, 65u8, 252u8, 12u8, 115u8, 46u8, 16u8, 200u8, 205u8, 23u8, + 125u8, 219u8, 214u8, 216u8, 124u8, 0u8, 32u8, 63u8, 7u8, 100u8, 144u8, 138u8, 212u8, 239u8, + 218u8, 218u8, 140u8, 20u8, 223u8, 248u8, 160u8, 132u8, 198u8, 50u8, 50u8, 74u8, 179u8, + 35u8, 65u8, 252u8, 121u8, 118u8, 204u8, 118u8, 5u8, 22u8, 193u8, 238u8, 37u8, 191u8, 42u8, + 231u8, 102u8, 180u8, 65u8, 245u8, 46u8, 83u8, 38u8, 142u8, 71u8, 233u8, 159u8, 159u8, + 151u8, 55u8, 211u8, 151u8, 98u8, 80u8, 4u8, 9u8, 120u8, 39u8, 220u8, 64u8, 235u8, 46u8, + 30u8, 180u8, 115u8, 112u8, + ], + vk_gamme_g2: [ + 41u8, 156u8, 48u8, 6u8, 253u8, 65u8, 197u8, 173u8, 136u8, 164u8, 71u8, 108u8, 110u8, 75u8, + 8u8, 119u8, 87u8, 8u8, 8u8, 80u8, 140u8, 117u8, 212u8, 215u8, 16u8, 92u8, 100u8, 229u8, + 37u8, 181u8, 28u8, 5u8, 43u8, 37u8, 174u8, 104u8, 172u8, 34u8, 189u8, 190u8, 141u8, 182u8, + 227u8, 150u8, 168u8, 203u8, 64u8, 182u8, 247u8, 21u8, 91u8, 242u8, 191u8, 240u8, 41u8, + 75u8, 191u8, 122u8, 84u8, 8u8, 84u8, 160u8, 177u8, 213u8, 15u8, 209u8, 9u8, 126u8, 113u8, + 247u8, 243u8, 190u8, 184u8, 49u8, 141u8, 255u8, 87u8, 71u8, 129u8, 6u8, 235u8, 245u8, + 125u8, 30u8, 222u8, 29u8, 254u8, 46u8, 108u8, 146u8, 187u8, 228u8, 174u8, 88u8, 206u8, + 23u8, 21u8, 133u8, 191u8, 158u8, 181u8, 23u8, 63u8, 101u8, 201u8, 88u8, 41u8, 227u8, 138u8, + 136u8, 215u8, 63u8, 7u8, 94u8, 13u8, 251u8, 100u8, 239u8, 16u8, 48u8, 232u8, 50u8, 151u8, + 52u8, 214u8, 41u8, 108u8, 44u8, + ], + vk_delta_g2: [ + 24u8, 193u8, 209u8, 211u8, 84u8, 6u8, 102u8, 7u8, 77u8, 1u8, 254u8, 220u8, 78u8, 207u8, + 33u8, 32u8, 76u8, 211u8, 251u8, 110u8, 93u8, 7u8, 43u8, 88u8, 226u8, 89u8, 1u8, 69u8, + 227u8, 72u8, 123u8, 125u8, 38u8, 250u8, 54u8, 110u8, 72u8, 78u8, 30u8, 176u8, 115u8, 250u8, + 159u8, 156u8, 80u8, 143u8, 75u8, 219u8, 6u8, 50u8, 39u8, 220u8, 7u8, 138u8, 167u8, 191u8, + 14u8, 147u8, 79u8, 54u8, 6u8, 255u8, 129u8, 92u8, 26u8, 31u8, 250u8, 222u8, 40u8, 66u8, + 122u8, 57u8, 19u8, 144u8, 191u8, 245u8, 141u8, 23u8, 51u8, 251u8, 103u8, 91u8, 121u8, + 239u8, 10u8, 64u8, 219u8, 159u8, 147u8, 135u8, 159u8, 241u8, 46u8, 168u8, 116u8, 66u8, + 48u8, 81u8, 139u8, 72u8, 111u8, 215u8, 88u8, 224u8, 101u8, 32u8, 215u8, 71u8, 128u8, 202u8, + 96u8, 22u8, 218u8, 229u8, 28u8, 8u8, 237u8, 244u8, 101u8, 33u8, 108u8, 195u8, 170u8, 18u8, + 30u8, 196u8, 165u8, 129u8, + ], + vk_ic: &[ + [ + 7u8, 125u8, 244u8, 126u8, 104u8, 186u8, 140u8, 225u8, 102u8, 51u8, 71u8, 155u8, 23u8, + 92u8, 218u8, 71u8, 217u8, 17u8, 224u8, 131u8, 248u8, 247u8, 128u8, 192u8, 45u8, 196u8, + 71u8, 32u8, 103u8, 235u8, 183u8, 181u8, 2u8, 136u8, 234u8, 79u8, 24u8, 3u8, 172u8, + 178u8, 37u8, 66u8, 54u8, 220u8, 217u8, 229u8, 6u8, 125u8, 211u8, 171u8, 109u8, 188u8, + 16u8, 243u8, 164u8, 50u8, 112u8, 229u8, 60u8, 217u8, 248u8, 63u8, 76u8, 49u8, + ], + [ + 14u8, 10u8, 206u8, 64u8, 59u8, 60u8, 190u8, 45u8, 84u8, 37u8, 24u8, 203u8, 115u8, + 239u8, 40u8, 130u8, 192u8, 29u8, 171u8, 216u8, 125u8, 77u8, 55u8, 187u8, 213u8, 106u8, + 101u8, 122u8, 224u8, 122u8, 11u8, 193u8, 26u8, 202u8, 196u8, 20u8, 190u8, 207u8, 236u8, + 130u8, 216u8, 119u8, 37u8, 120u8, 7u8, 96u8, 38u8, 87u8, 21u8, 136u8, 241u8, 206u8, + 50u8, 215u8, 119u8, 35u8, 36u8, 189u8, 184u8, 37u8, 12u8, 128u8, 135u8, 106u8, + ], + [ + 5u8, 164u8, 105u8, 230u8, 73u8, 202u8, 222u8, 54u8, 133u8, 157u8, 130u8, 91u8, 84u8, + 29u8, 19u8, 24u8, 246u8, 136u8, 190u8, 80u8, 28u8, 229u8, 251u8, 164u8, 77u8, 238u8, + 79u8, 42u8, 225u8, 3u8, 134u8, 92u8, 24u8, 12u8, 85u8, 154u8, 18u8, 228u8, 52u8, 169u8, + 85u8, 84u8, 183u8, 157u8, 111u8, 249u8, 57u8, 220u8, 245u8, 231u8, 102u8, 240u8, 204u8, + 66u8, 18u8, 6u8, 106u8, 136u8, 103u8, 112u8, 151u8, 199u8, 247u8, 26u8, + ], + ], +}; diff --git a/programs/compressed-pda/src/verifying_keys/non-inclusion_26_2.rs b/programs/compressed-pda/src/verifying_keys/non-inclusion_26_2.rs new file mode 100644 index 0000000000..1ce933a67a --- /dev/null +++ b/programs/compressed-pda/src/verifying_keys/non-inclusion_26_2.rs @@ -0,0 +1,86 @@ +// This file is generated by xtask. Do not edit it manually. + +use groth16_solana::groth16::Groth16Verifyingkey; +pub const VERIFYINGKEY: Groth16Verifyingkey = Groth16Verifyingkey { + nr_pubinputs: 4usize, + vk_alpha_g1: [ + 6u8, 249u8, 254u8, 244u8, 13u8, 162u8, 98u8, 207u8, 188u8, 196u8, 197u8, 66u8, 142u8, 48u8, + 200u8, 110u8, 139u8, 72u8, 151u8, 23u8, 204u8, 231u8, 71u8, 236u8, 20u8, 56u8, 199u8, + 237u8, 45u8, 161u8, 15u8, 132u8, 5u8, 33u8, 157u8, 226u8, 169u8, 129u8, 113u8, 88u8, 53u8, + 28u8, 57u8, 79u8, 168u8, 131u8, 114u8, 99u8, 5u8, 81u8, 235u8, 100u8, 161u8, 237u8, 238u8, + 182u8, 48u8, 2u8, 159u8, 140u8, 7u8, 198u8, 247u8, 150u8, + ], + vk_beta_g2: [ + 17u8, 26u8, 86u8, 180u8, 38u8, 81u8, 91u8, 158u8, 228u8, 87u8, 98u8, 188u8, 75u8, 73u8, + 249u8, 59u8, 217u8, 90u8, 137u8, 212u8, 223u8, 191u8, 2u8, 205u8, 117u8, 237u8, 162u8, + 243u8, 127u8, 47u8, 161u8, 109u8, 31u8, 190u8, 71u8, 73u8, 214u8, 217u8, 225u8, 239u8, + 45u8, 227u8, 46u8, 242u8, 243u8, 150u8, 127u8, 219u8, 21u8, 129u8, 125u8, 133u8, 19u8, + 146u8, 93u8, 125u8, 118u8, 55u8, 109u8, 91u8, 153u8, 229u8, 242u8, 213u8, 45u8, 113u8, + 144u8, 94u8, 13u8, 172u8, 35u8, 237u8, 35u8, 175u8, 68u8, 111u8, 89u8, 52u8, 177u8, 175u8, + 123u8, 171u8, 20u8, 24u8, 217u8, 232u8, 225u8, 198u8, 50u8, 103u8, 147u8, 115u8, 101u8, + 132u8, 5u8, 118u8, 47u8, 62u8, 137u8, 136u8, 67u8, 20u8, 184u8, 66u8, 32u8, 179u8, 47u8, + 2u8, 95u8, 191u8, 141u8, 141u8, 113u8, 76u8, 205u8, 192u8, 78u8, 120u8, 212u8, 212u8, + 142u8, 15u8, 154u8, 243u8, 111u8, 153u8, 140u8, 251u8, + ], + vk_gamme_g2: [ + 30u8, 75u8, 168u8, 21u8, 15u8, 86u8, 152u8, 15u8, 229u8, 52u8, 112u8, 127u8, 38u8, 36u8, + 61u8, 33u8, 144u8, 146u8, 26u8, 95u8, 55u8, 137u8, 188u8, 49u8, 52u8, 177u8, 99u8, 24u8, + 71u8, 214u8, 168u8, 56u8, 40u8, 90u8, 150u8, 20u8, 20u8, 26u8, 101u8, 41u8, 117u8, 49u8, + 14u8, 107u8, 92u8, 251u8, 240u8, 201u8, 45u8, 223u8, 61u8, 180u8, 127u8, 161u8, 160u8, + 77u8, 12u8, 162u8, 181u8, 123u8, 222u8, 112u8, 216u8, 0u8, 24u8, 129u8, 133u8, 148u8, + 185u8, 245u8, 166u8, 209u8, 177u8, 78u8, 174u8, 94u8, 227u8, 75u8, 252u8, 34u8, 150u8, 8u8, + 167u8, 178u8, 139u8, 17u8, 89u8, 206u8, 67u8, 69u8, 219u8, 226u8, 189u8, 19u8, 240u8, + 193u8, 10u8, 202u8, 234u8, 181u8, 128u8, 110u8, 245u8, 40u8, 89u8, 171u8, 101u8, 142u8, + 28u8, 253u8, 164u8, 150u8, 175u8, 17u8, 19u8, 182u8, 220u8, 46u8, 209u8, 66u8, 16u8, 230u8, + 3u8, 201u8, 210u8, 27u8, 112u8, 16u8, + ], + vk_delta_g2: [ + 33u8, 247u8, 111u8, 88u8, 229u8, 166u8, 2u8, 221u8, 37u8, 177u8, 103u8, 160u8, 225u8, 41u8, + 244u8, 38u8, 25u8, 17u8, 213u8, 91u8, 139u8, 214u8, 3u8, 162u8, 76u8, 55u8, 231u8, 30u8, + 70u8, 120u8, 226u8, 93u8, 3u8, 82u8, 223u8, 70u8, 163u8, 213u8, 50u8, 36u8, 10u8, 45u8, + 19u8, 236u8, 87u8, 163u8, 44u8, 67u8, 128u8, 236u8, 90u8, 117u8, 147u8, 140u8, 182u8, + 138u8, 182u8, 11u8, 235u8, 146u8, 107u8, 251u8, 76u8, 8u8, 22u8, 70u8, 164u8, 88u8, 38u8, + 11u8, 229u8, 92u8, 176u8, 109u8, 37u8, 158u8, 215u8, 62u8, 42u8, 171u8, 227u8, 110u8, + 209u8, 187u8, 74u8, 75u8, 92u8, 226u8, 249u8, 40u8, 21u8, 161u8, 115u8, 93u8, 151u8, 168u8, + 0u8, 69u8, 35u8, 248u8, 147u8, 228u8, 166u8, 48u8, 136u8, 203u8, 244u8, 102u8, 231u8, 37u8, + 180u8, 0u8, 117u8, 238u8, 4u8, 120u8, 68u8, 202u8, 102u8, 151u8, 104u8, 163u8, 187u8, + 179u8, 207u8, 166u8, 81u8, 153u8, + ], + vk_ic: &[ + [ + 25u8, 164u8, 147u8, 186u8, 149u8, 26u8, 42u8, 211u8, 23u8, 187u8, 16u8, 99u8, 77u8, + 32u8, 5u8, 109u8, 45u8, 112u8, 213u8, 86u8, 81u8, 116u8, 176u8, 166u8, 157u8, 180u8, + 173u8, 122u8, 210u8, 121u8, 202u8, 204u8, 35u8, 86u8, 114u8, 181u8, 232u8, 57u8, 153u8, + 236u8, 190u8, 129u8, 164u8, 69u8, 241u8, 15u8, 136u8, 183u8, 144u8, 212u8, 99u8, 47u8, + 183u8, 8u8, 128u8, 208u8, 197u8, 254u8, 76u8, 239u8, 106u8, 206u8, 12u8, 41u8, + ], + [ + 1u8, 28u8, 27u8, 168u8, 151u8, 178u8, 158u8, 101u8, 91u8, 156u8, 205u8, 49u8, 163u8, + 47u8, 96u8, 1u8, 158u8, 181u8, 154u8, 80u8, 124u8, 246u8, 151u8, 156u8, 40u8, 56u8, + 200u8, 58u8, 54u8, 195u8, 84u8, 137u8, 15u8, 22u8, 121u8, 246u8, 72u8, 53u8, 189u8, + 215u8, 192u8, 93u8, 179u8, 99u8, 98u8, 145u8, 248u8, 114u8, 254u8, 216u8, 151u8, 63u8, + 214u8, 34u8, 19u8, 79u8, 180u8, 186u8, 77u8, 130u8, 239u8, 145u8, 50u8, 139u8, + ], + [ + 47u8, 194u8, 11u8, 193u8, 20u8, 67u8, 9u8, 32u8, 89u8, 49u8, 219u8, 139u8, 209u8, + 178u8, 186u8, 63u8, 29u8, 117u8, 127u8, 153u8, 12u8, 25u8, 200u8, 131u8, 191u8, 97u8, + 208u8, 215u8, 20u8, 78u8, 141u8, 44u8, 41u8, 201u8, 55u8, 253u8, 251u8, 19u8, 250u8, + 134u8, 56u8, 97u8, 211u8, 157u8, 192u8, 158u8, 117u8, 149u8, 240u8, 100u8, 13u8, 232u8, + 187u8, 110u8, 139u8, 252u8, 116u8, 91u8, 152u8, 139u8, 43u8, 206u8, 86u8, 183u8, + ], + [ + 12u8, 235u8, 185u8, 48u8, 82u8, 120u8, 186u8, 65u8, 59u8, 94u8, 107u8, 175u8, 54u8, + 160u8, 28u8, 61u8, 172u8, 240u8, 110u8, 41u8, 201u8, 82u8, 191u8, 199u8, 53u8, 197u8, + 173u8, 154u8, 22u8, 61u8, 46u8, 133u8, 27u8, 48u8, 177u8, 130u8, 77u8, 224u8, 128u8, + 73u8, 23u8, 43u8, 134u8, 239u8, 47u8, 207u8, 57u8, 16u8, 69u8, 213u8, 225u8, 81u8, + 213u8, 103u8, 59u8, 83u8, 105u8, 55u8, 250u8, 162u8, 29u8, 100u8, 1u8, 150u8, + ], + [ + 27u8, 111u8, 233u8, 96u8, 164u8, 57u8, 221u8, 17u8, 53u8, 198u8, 194u8, 70u8, 85u8, + 38u8, 62u8, 211u8, 164u8, 196u8, 36u8, 94u8, 169u8, 230u8, 183u8, 183u8, 49u8, 66u8, + 151u8, 193u8, 58u8, 161u8, 87u8, 102u8, 5u8, 189u8, 25u8, 188u8, 142u8, 183u8, 98u8, + 183u8, 207u8, 112u8, 76u8, 100u8, 29u8, 64u8, 121u8, 226u8, 168u8, 74u8, 146u8, 130u8, + 250u8, 23u8, 80u8, 203u8, 140u8, 158u8, 145u8, 182u8, 184u8, 131u8, 13u8, 133u8, + ], + ], +}; diff --git a/programs/compressed-pda/src/verifying_keys/non-inclusion_26_3.rs b/programs/compressed-pda/src/verifying_keys/non-inclusion_26_3.rs new file mode 100644 index 0000000000..660c74e81b --- /dev/null +++ b/programs/compressed-pda/src/verifying_keys/non-inclusion_26_3.rs @@ -0,0 +1,100 @@ +// This file is generated by xtask. Do not edit it manually. + +use groth16_solana::groth16::Groth16Verifyingkey; +pub const VERIFYINGKEY: Groth16Verifyingkey = Groth16Verifyingkey { + nr_pubinputs: 6usize, + vk_alpha_g1: [ + 15u8, 164u8, 120u8, 125u8, 2u8, 76u8, 162u8, 112u8, 106u8, 186u8, 86u8, 16u8, 39u8, 26u8, + 57u8, 77u8, 17u8, 172u8, 244u8, 216u8, 173u8, 61u8, 251u8, 99u8, 181u8, 56u8, 154u8, 11u8, + 205u8, 120u8, 230u8, 89u8, 23u8, 56u8, 173u8, 109u8, 161u8, 245u8, 159u8, 156u8, 223u8, + 218u8, 255u8, 236u8, 209u8, 2u8, 115u8, 97u8, 83u8, 108u8, 105u8, 254u8, 104u8, 214u8, + 91u8, 157u8, 197u8, 255u8, 211u8, 231u8, 136u8, 223u8, 173u8, 145u8, + ], + vk_beta_g2: [ + 19u8, 154u8, 198u8, 238u8, 103u8, 146u8, 78u8, 188u8, 231u8, 229u8, 9u8, 220u8, 45u8, + 138u8, 88u8, 237u8, 201u8, 231u8, 78u8, 223u8, 169u8, 209u8, 58u8, 16u8, 209u8, 169u8, + 89u8, 139u8, 99u8, 238u8, 116u8, 63u8, 1u8, 52u8, 202u8, 221u8, 168u8, 229u8, 182u8, 90u8, + 222u8, 59u8, 72u8, 160u8, 112u8, 78u8, 18u8, 219u8, 171u8, 18u8, 43u8, 167u8, 113u8, 167u8, + 114u8, 179u8, 254u8, 213u8, 189u8, 204u8, 128u8, 15u8, 78u8, 217u8, 47u8, 84u8, 82u8, + 219u8, 15u8, 49u8, 62u8, 248u8, 87u8, 152u8, 58u8, 248u8, 237u8, 180u8, 245u8, 56u8, 21u8, + 141u8, 4u8, 213u8, 12u8, 83u8, 109u8, 94u8, 110u8, 101u8, 73u8, 82u8, 58u8, 39u8, 219u8, + 93u8, 35u8, 54u8, 141u8, 34u8, 224u8, 93u8, 117u8, 161u8, 87u8, 156u8, 124u8, 150u8, 234u8, + 167u8, 123u8, 208u8, 72u8, 226u8, 80u8, 133u8, 39u8, 154u8, 248u8, 81u8, 176u8, 101u8, + 118u8, 85u8, 16u8, 250u8, 243u8, 232u8, + ], + vk_gamme_g2: [ + 18u8, 28u8, 150u8, 35u8, 251u8, 196u8, 216u8, 208u8, 77u8, 210u8, 255u8, 245u8, 199u8, + 207u8, 44u8, 77u8, 77u8, 245u8, 214u8, 58u8, 54u8, 251u8, 74u8, 0u8, 11u8, 47u8, 114u8, + 240u8, 149u8, 206u8, 120u8, 249u8, 32u8, 112u8, 128u8, 239u8, 5u8, 142u8, 237u8, 220u8, + 3u8, 86u8, 65u8, 38u8, 117u8, 2u8, 52u8, 80u8, 12u8, 142u8, 193u8, 174u8, 165u8, 185u8, + 228u8, 162u8, 143u8, 252u8, 128u8, 141u8, 138u8, 49u8, 119u8, 11u8, 16u8, 65u8, 9u8, 172u8, + 1u8, 189u8, 29u8, 48u8, 217u8, 80u8, 191u8, 223u8, 6u8, 142u8, 43u8, 193u8, 136u8, 68u8, + 68u8, 40u8, 129u8, 38u8, 190u8, 7u8, 158u8, 71u8, 251u8, 105u8, 142u8, 222u8, 124u8, 4u8, + 8u8, 29u8, 59u8, 238u8, 85u8, 246u8, 63u8, 21u8, 36u8, 191u8, 151u8, 107u8, 4u8, 135u8, + 82u8, 206u8, 252u8, 253u8, 76u8, 110u8, 32u8, 160u8, 252u8, 49u8, 16u8, 29u8, 165u8, 182u8, + 31u8, 224u8, 99u8, 116u8, + ], + vk_delta_g2: [ + 41u8, 140u8, 83u8, 201u8, 163u8, 174u8, 46u8, 160u8, 208u8, 202u8, 248u8, 233u8, 208u8, + 62u8, 110u8, 47u8, 85u8, 193u8, 106u8, 223u8, 159u8, 151u8, 126u8, 182u8, 149u8, 28u8, + 122u8, 116u8, 210u8, 27u8, 72u8, 214u8, 33u8, 56u8, 73u8, 49u8, 199u8, 230u8, 225u8, 136u8, + 214u8, 57u8, 203u8, 73u8, 193u8, 139u8, 213u8, 90u8, 242u8, 231u8, 155u8, 87u8, 153u8, + 240u8, 94u8, 253u8, 142u8, 17u8, 244u8, 170u8, 178u8, 94u8, 187u8, 237u8, 33u8, 180u8, + 75u8, 230u8, 238u8, 236u8, 52u8, 124u8, 160u8, 187u8, 88u8, 13u8, 141u8, 96u8, 172u8, 78u8, + 176u8, 103u8, 193u8, 154u8, 65u8, 136u8, 76u8, 195u8, 253u8, 176u8, 211u8, 174u8, 112u8, + 2u8, 246u8, 166u8, 26u8, 94u8, 14u8, 241u8, 60u8, 34u8, 79u8, 159u8, 130u8, 99u8, 79u8, + 217u8, 85u8, 21u8, 234u8, 101u8, 72u8, 83u8, 145u8, 119u8, 93u8, 215u8, 101u8, 181u8, + 116u8, 49u8, 184u8, 188u8, 208u8, 159u8, 146u8, 78u8, + ], + vk_ic: &[ + [ + 29u8, 235u8, 209u8, 206u8, 106u8, 197u8, 144u8, 76u8, 253u8, 1u8, 115u8, 229u8, 67u8, + 253u8, 98u8, 59u8, 207u8, 128u8, 21u8, 222u8, 127u8, 7u8, 220u8, 59u8, 131u8, 99u8, + 53u8, 227u8, 155u8, 98u8, 203u8, 117u8, 33u8, 200u8, 194u8, 255u8, 115u8, 78u8, 228u8, + 148u8, 176u8, 38u8, 228u8, 203u8, 27u8, 33u8, 116u8, 70u8, 167u8, 24u8, 138u8, 4u8, + 129u8, 44u8, 175u8, 39u8, 82u8, 163u8, 113u8, 181u8, 10u8, 222u8, 166u8, 154u8, + ], + [ + 3u8, 78u8, 234u8, 148u8, 123u8, 213u8, 86u8, 5u8, 18u8, 128u8, 229u8, 195u8, 89u8, + 145u8, 183u8, 24u8, 177u8, 64u8, 99u8, 48u8, 195u8, 15u8, 228u8, 126u8, 8u8, 169u8, + 121u8, 184u8, 52u8, 111u8, 91u8, 170u8, 45u8, 199u8, 20u8, 177u8, 33u8, 51u8, 214u8, + 154u8, 42u8, 43u8, 63u8, 55u8, 180u8, 148u8, 107u8, 197u8, 169u8, 171u8, 67u8, 224u8, + 146u8, 214u8, 241u8, 61u8, 140u8, 162u8, 250u8, 47u8, 44u8, 127u8, 183u8, 151u8, + ], + [ + 31u8, 254u8, 69u8, 184u8, 54u8, 183u8, 197u8, 73u8, 245u8, 71u8, 17u8, 197u8, 80u8, + 67u8, 76u8, 198u8, 239u8, 150u8, 135u8, 193u8, 242u8, 181u8, 182u8, 43u8, 47u8, 56u8, + 0u8, 195u8, 102u8, 137u8, 224u8, 34u8, 37u8, 213u8, 232u8, 113u8, 96u8, 94u8, 68u8, + 18u8, 229u8, 24u8, 151u8, 211u8, 217u8, 98u8, 53u8, 31u8, 225u8, 68u8, 174u8, 69u8, + 222u8, 191u8, 28u8, 142u8, 26u8, 87u8, 1u8, 38u8, 183u8, 161u8, 234u8, 119u8, + ], + [ + 26u8, 210u8, 70u8, 61u8, 191u8, 0u8, 241u8, 249u8, 88u8, 204u8, 206u8, 26u8, 134u8, + 218u8, 107u8, 147u8, 179u8, 37u8, 132u8, 252u8, 39u8, 40u8, 68u8, 203u8, 46u8, 173u8, + 48u8, 115u8, 207u8, 185u8, 56u8, 116u8, 30u8, 25u8, 24u8, 24u8, 214u8, 204u8, 22u8, + 70u8, 222u8, 109u8, 211u8, 206u8, 199u8, 82u8, 205u8, 140u8, 57u8, 17u8, 254u8, 15u8, + 118u8, 135u8, 102u8, 212u8, 200u8, 117u8, 70u8, 127u8, 217u8, 218u8, 123u8, 56u8, + ], + [ + 27u8, 216u8, 97u8, 200u8, 19u8, 82u8, 12u8, 44u8, 214u8, 150u8, 143u8, 197u8, 155u8, + 92u8, 99u8, 247u8, 250u8, 241u8, 125u8, 4u8, 25u8, 118u8, 173u8, 9u8, 10u8, 97u8, + 205u8, 200u8, 28u8, 224u8, 130u8, 47u8, 28u8, 8u8, 77u8, 58u8, 33u8, 191u8, 90u8, 67u8, + 195u8, 37u8, 95u8, 144u8, 114u8, 99u8, 73u8, 114u8, 255u8, 55u8, 129u8, 213u8, 68u8, + 195u8, 168u8, 131u8, 162u8, 228u8, 83u8, 186u8, 235u8, 148u8, 180u8, 153u8, + ], + [ + 25u8, 192u8, 216u8, 86u8, 226u8, 206u8, 253u8, 13u8, 215u8, 25u8, 191u8, 134u8, 235u8, + 87u8, 250u8, 199u8, 7u8, 57u8, 130u8, 196u8, 168u8, 35u8, 103u8, 84u8, 170u8, 249u8, + 58u8, 18u8, 247u8, 157u8, 31u8, 153u8, 3u8, 182u8, 49u8, 71u8, 103u8, 157u8, 84u8, + 218u8, 78u8, 249u8, 45u8, 62u8, 124u8, 33u8, 26u8, 180u8, 83u8, 71u8, 60u8, 58u8, 28u8, + 201u8, 41u8, 212u8, 241u8, 214u8, 228u8, 42u8, 194u8, 9u8, 103u8, 55u8, + ], + [ + 20u8, 242u8, 91u8, 72u8, 69u8, 225u8, 26u8, 196u8, 130u8, 226u8, 27u8, 64u8, 81u8, + 250u8, 91u8, 200u8, 30u8, 223u8, 224u8, 98u8, 134u8, 159u8, 82u8, 160u8, 42u8, 184u8, + 215u8, 108u8, 196u8, 63u8, 129u8, 233u8, 37u8, 154u8, 106u8, 169u8, 26u8, 174u8, 133u8, + 128u8, 64u8, 153u8, 207u8, 63u8, 146u8, 171u8, 86u8, 9u8, 171u8, 48u8, 249u8, 151u8, + 255u8, 63u8, 76u8, 210u8, 172u8, 9u8, 95u8, 15u8, 255u8, 146u8, 201u8, 33u8, + ], + ], +}; diff --git a/programs/compressed-pda/src/verifying_keys/non-inclusion_26_4.rs b/programs/compressed-pda/src/verifying_keys/non-inclusion_26_4.rs new file mode 100644 index 0000000000..6cc077283d --- /dev/null +++ b/programs/compressed-pda/src/verifying_keys/non-inclusion_26_4.rs @@ -0,0 +1,114 @@ +// This file is generated by xtask. Do not edit it manually. + +use groth16_solana::groth16::Groth16Verifyingkey; +pub const VERIFYINGKEY: Groth16Verifyingkey = Groth16Verifyingkey { + nr_pubinputs: 8usize, + vk_alpha_g1: [ + 27u8, 148u8, 121u8, 69u8, 109u8, 234u8, 25u8, 195u8, 139u8, 209u8, 233u8, 124u8, 149u8, + 56u8, 228u8, 121u8, 149u8, 255u8, 36u8, 69u8, 70u8, 35u8, 219u8, 68u8, 10u8, 253u8, 47u8, + 53u8, 179u8, 178u8, 100u8, 164u8, 26u8, 144u8, 189u8, 32u8, 72u8, 220u8, 96u8, 177u8, 31u8, + 18u8, 236u8, 231u8, 67u8, 88u8, 100u8, 81u8, 76u8, 11u8, 191u8, 197u8, 69u8, 17u8, 62u8, + 7u8, 126u8, 52u8, 0u8, 222u8, 149u8, 103u8, 74u8, 123u8, + ], + vk_beta_g2: [ + 35u8, 215u8, 134u8, 36u8, 192u8, 98u8, 135u8, 226u8, 141u8, 102u8, 53u8, 15u8, 223u8, + 119u8, 18u8, 167u8, 164u8, 1u8, 250u8, 124u8, 60u8, 45u8, 110u8, 12u8, 152u8, 119u8, 75u8, + 155u8, 156u8, 33u8, 113u8, 30u8, 8u8, 104u8, 160u8, 35u8, 123u8, 62u8, 42u8, 64u8, 14u8, + 67u8, 78u8, 119u8, 132u8, 111u8, 245u8, 68u8, 127u8, 19u8, 235u8, 200u8, 96u8, 126u8, 43u8, + 8u8, 204u8, 228u8, 11u8, 89u8, 105u8, 184u8, 131u8, 95u8, 8u8, 122u8, 35u8, 189u8, 244u8, + 25u8, 246u8, 201u8, 99u8, 58u8, 110u8, 190u8, 211u8, 56u8, 45u8, 61u8, 66u8, 74u8, 42u8, + 216u8, 33u8, 204u8, 153u8, 230u8, 227u8, 146u8, 34u8, 101u8, 44u8, 239u8, 126u8, 82u8, + 11u8, 147u8, 52u8, 114u8, 133u8, 74u8, 181u8, 222u8, 142u8, 52u8, 100u8, 218u8, 51u8, + 171u8, 86u8, 230u8, 128u8, 4u8, 6u8, 15u8, 189u8, 105u8, 75u8, 252u8, 122u8, 166u8, 187u8, + 37u8, 39u8, 132u8, 154u8, 69u8, + ], + vk_gamme_g2: [ + 9u8, 37u8, 123u8, 94u8, 111u8, 236u8, 220u8, 91u8, 53u8, 153u8, 11u8, 179u8, 151u8, 2u8, + 109u8, 53u8, 83u8, 82u8, 241u8, 212u8, 204u8, 88u8, 78u8, 221u8, 136u8, 196u8, 60u8, 40u8, + 87u8, 31u8, 191u8, 63u8, 44u8, 172u8, 253u8, 144u8, 186u8, 55u8, 8u8, 159u8, 122u8, 186u8, + 62u8, 57u8, 196u8, 137u8, 57u8, 168u8, 111u8, 157u8, 120u8, 44u8, 9u8, 165u8, 25u8, 170u8, + 134u8, 119u8, 49u8, 150u8, 51u8, 18u8, 163u8, 254u8, 19u8, 107u8, 83u8, 164u8, 231u8, + 207u8, 85u8, 22u8, 80u8, 115u8, 3u8, 129u8, 25u8, 9u8, 236u8, 190u8, 143u8, 147u8, 73u8, + 13u8, 171u8, 237u8, 229u8, 240u8, 177u8, 80u8, 137u8, 206u8, 180u8, 137u8, 149u8, 12u8, + 6u8, 126u8, 73u8, 18u8, 104u8, 142u8, 37u8, 194u8, 71u8, 168u8, 59u8, 166u8, 173u8, 195u8, + 122u8, 196u8, 244u8, 138u8, 2u8, 113u8, 58u8, 129u8, 71u8, 163u8, 75u8, 46u8, 111u8, 208u8, + 60u8, 226u8, 92u8, 1u8, + ], + vk_delta_g2: [ + 15u8, 103u8, 51u8, 138u8, 155u8, 116u8, 81u8, 112u8, 70u8, 74u8, 147u8, 217u8, 152u8, 49u8, + 219u8, 198u8, 85u8, 105u8, 50u8, 230u8, 48u8, 8u8, 99u8, 77u8, 73u8, 152u8, 25u8, 219u8, + 62u8, 151u8, 220u8, 97u8, 26u8, 208u8, 89u8, 155u8, 201u8, 223u8, 40u8, 141u8, 193u8, + 166u8, 181u8, 45u8, 20u8, 170u8, 130u8, 21u8, 74u8, 130u8, 172u8, 246u8, 17u8, 191u8, 32u8, + 195u8, 114u8, 10u8, 89u8, 51u8, 48u8, 183u8, 15u8, 238u8, 15u8, 213u8, 16u8, 205u8, 241u8, + 59u8, 126u8, 244u8, 200u8, 115u8, 65u8, 13u8, 222u8, 37u8, 72u8, 233u8, 242u8, 105u8, + 222u8, 72u8, 190u8, 169u8, 182u8, 3u8, 240u8, 194u8, 92u8, 132u8, 247u8, 51u8, 2u8, 20u8, + 42u8, 187u8, 219u8, 84u8, 219u8, 189u8, 187u8, 11u8, 54u8, 238u8, 240u8, 29u8, 110u8, + 147u8, 113u8, 225u8, 43u8, 196u8, 98u8, 185u8, 225u8, 81u8, 54u8, 86u8, 51u8, 161u8, 212u8, + 137u8, 124u8, 155u8, 36u8, 90u8, + ], + vk_ic: &[ + [ + 26u8, 40u8, 234u8, 213u8, 177u8, 65u8, 199u8, 87u8, 78u8, 0u8, 158u8, 2u8, 127u8, + 198u8, 20u8, 242u8, 108u8, 242u8, 29u8, 84u8, 133u8, 144u8, 206u8, 187u8, 115u8, 209u8, + 89u8, 245u8, 245u8, 95u8, 75u8, 36u8, 13u8, 102u8, 217u8, 143u8, 200u8, 219u8, 20u8, + 165u8, 197u8, 95u8, 79u8, 105u8, 191u8, 162u8, 34u8, 41u8, 167u8, 181u8, 29u8, 79u8, + 35u8, 110u8, 246u8, 127u8, 227u8, 50u8, 222u8, 37u8, 182u8, 229u8, 32u8, 209u8, + ], + [ + 23u8, 160u8, 23u8, 221u8, 151u8, 24u8, 102u8, 13u8, 55u8, 12u8, 155u8, 65u8, 60u8, + 22u8, 15u8, 177u8, 3u8, 8u8, 39u8, 113u8, 83u8, 178u8, 183u8, 37u8, 194u8, 215u8, + 103u8, 90u8, 83u8, 198u8, 162u8, 151u8, 34u8, 79u8, 149u8, 222u8, 84u8, 245u8, 61u8, + 69u8, 194u8, 137u8, 190u8, 245u8, 191u8, 204u8, 138u8, 10u8, 68u8, 142u8, 116u8, 80u8, + 66u8, 230u8, 97u8, 87u8, 133u8, 217u8, 173u8, 174u8, 57u8, 1u8, 83u8, 215u8, + ], + [ + 44u8, 131u8, 39u8, 79u8, 29u8, 30u8, 190u8, 96u8, 50u8, 95u8, 16u8, 136u8, 48u8, 251u8, + 89u8, 8u8, 95u8, 65u8, 244u8, 140u8, 230u8, 55u8, 229u8, 44u8, 207u8, 73u8, 131u8, + 97u8, 123u8, 146u8, 61u8, 18u8, 5u8, 190u8, 241u8, 174u8, 86u8, 110u8, 82u8, 37u8, + 25u8, 243u8, 238u8, 141u8, 27u8, 19u8, 12u8, 178u8, 2u8, 69u8, 245u8, 121u8, 42u8, + 10u8, 49u8, 252u8, 42u8, 12u8, 251u8, 104u8, 254u8, 120u8, 75u8, 89u8, + ], + [ + 17u8, 251u8, 38u8, 101u8, 22u8, 9u8, 188u8, 146u8, 44u8, 226u8, 191u8, 96u8, 93u8, + 35u8, 135u8, 222u8, 124u8, 140u8, 232u8, 152u8, 226u8, 2u8, 34u8, 209u8, 77u8, 126u8, + 190u8, 51u8, 1u8, 163u8, 52u8, 55u8, 19u8, 54u8, 30u8, 148u8, 83u8, 106u8, 8u8, 55u8, + 6u8, 166u8, 244u8, 145u8, 66u8, 248u8, 190u8, 240u8, 139u8, 243u8, 9u8, 37u8, 216u8, + 5u8, 41u8, 211u8, 115u8, 166u8, 109u8, 161u8, 240u8, 9u8, 87u8, 16u8, + ], + [ + 21u8, 18u8, 220u8, 77u8, 46u8, 106u8, 66u8, 252u8, 231u8, 34u8, 154u8, 166u8, 93u8, + 156u8, 115u8, 205u8, 204u8, 48u8, 133u8, 247u8, 19u8, 144u8, 152u8, 101u8, 126u8, 74u8, + 241u8, 74u8, 49u8, 67u8, 167u8, 61u8, 45u8, 28u8, 225u8, 10u8, 191u8, 196u8, 145u8, + 14u8, 95u8, 171u8, 87u8, 153u8, 162u8, 18u8, 26u8, 95u8, 200u8, 199u8, 119u8, 10u8, + 16u8, 24u8, 48u8, 64u8, 37u8, 56u8, 42u8, 30u8, 200u8, 250u8, 107u8, 205u8, + ], + [ + 25u8, 226u8, 162u8, 171u8, 21u8, 208u8, 83u8, 207u8, 243u8, 235u8, 154u8, 27u8, 244u8, + 163u8, 40u8, 131u8, 195u8, 154u8, 51u8, 226u8, 36u8, 68u8, 72u8, 43u8, 249u8, 220u8, + 118u8, 69u8, 72u8, 10u8, 36u8, 53u8, 47u8, 145u8, 250u8, 56u8, 135u8, 187u8, 66u8, + 176u8, 60u8, 205u8, 132u8, 201u8, 94u8, 210u8, 60u8, 46u8, 42u8, 196u8, 44u8, 101u8, + 218u8, 166u8, 229u8, 104u8, 126u8, 150u8, 102u8, 124u8, 109u8, 115u8, 77u8, 226u8, + ], + [ + 20u8, 43u8, 196u8, 86u8, 53u8, 127u8, 175u8, 228u8, 223u8, 10u8, 22u8, 159u8, 136u8, + 229u8, 83u8, 115u8, 115u8, 43u8, 202u8, 161u8, 78u8, 186u8, 212u8, 99u8, 133u8, 223u8, + 123u8, 226u8, 182u8, 166u8, 86u8, 218u8, 21u8, 49u8, 198u8, 65u8, 64u8, 136u8, 109u8, + 41u8, 125u8, 37u8, 14u8, 220u8, 100u8, 49u8, 98u8, 77u8, 120u8, 121u8, 220u8, 16u8, + 165u8, 244u8, 113u8, 159u8, 60u8, 55u8, 28u8, 43u8, 68u8, 131u8, 55u8, 198u8, + ], + [ + 11u8, 142u8, 213u8, 157u8, 43u8, 3u8, 48u8, 161u8, 100u8, 128u8, 31u8, 193u8, 75u8, + 252u8, 4u8, 53u8, 208u8, 37u8, 167u8, 136u8, 146u8, 5u8, 53u8, 194u8, 14u8, 149u8, + 105u8, 174u8, 199u8, 87u8, 124u8, 71u8, 20u8, 213u8, 125u8, 184u8, 58u8, 33u8, 176u8, + 74u8, 131u8, 89u8, 200u8, 201u8, 173u8, 175u8, 45u8, 91u8, 101u8, 100u8, 237u8, 222u8, + 9u8, 135u8, 165u8, 5u8, 133u8, 59u8, 150u8, 238u8, 40u8, 55u8, 227u8, 50u8, + ], + [ + 12u8, 47u8, 233u8, 182u8, 93u8, 92u8, 235u8, 29u8, 12u8, 228u8, 150u8, 116u8, 249u8, + 223u8, 147u8, 96u8, 15u8, 45u8, 68u8, 16u8, 1u8, 32u8, 206u8, 80u8, 29u8, 253u8, 18u8, + 11u8, 20u8, 189u8, 39u8, 39u8, 3u8, 112u8, 73u8, 68u8, 239u8, 27u8, 172u8, 56u8, 109u8, + 210u8, 8u8, 26u8, 100u8, 167u8, 30u8, 15u8, 150u8, 216u8, 158u8, 28u8, 248u8, 186u8, + 113u8, 51u8, 249u8, 49u8, 1u8, 207u8, 66u8, 233u8, 196u8, 230u8, + ], + ], +}; diff --git a/programs/compressed-pda/src/verifying_keys/non-inclusion_26_8.rs b/programs/compressed-pda/src/verifying_keys/non-inclusion_26_8.rs new file mode 100644 index 0000000000..b1b2a6b1ed --- /dev/null +++ b/programs/compressed-pda/src/verifying_keys/non-inclusion_26_8.rs @@ -0,0 +1,170 @@ +// This file is generated by xtask. Do not edit it manually. + +use groth16_solana::groth16::Groth16Verifyingkey; +pub const VERIFYINGKEY: Groth16Verifyingkey = Groth16Verifyingkey { + nr_pubinputs: 16usize, + vk_alpha_g1: [ + 12u8, 15u8, 247u8, 252u8, 133u8, 255u8, 211u8, 96u8, 220u8, 145u8, 61u8, 107u8, 156u8, + 169u8, 236u8, 107u8, 175u8, 248u8, 115u8, 151u8, 211u8, 44u8, 75u8, 158u8, 75u8, 217u8, + 85u8, 231u8, 28u8, 70u8, 69u8, 83u8, 46u8, 83u8, 192u8, 161u8, 189u8, 51u8, 169u8, 239u8, + 12u8, 168u8, 137u8, 120u8, 85u8, 45u8, 227u8, 202u8, 62u8, 149u8, 2u8, 95u8, 186u8, 100u8, + 6u8, 249u8, 24u8, 207u8, 183u8, 188u8, 19u8, 189u8, 204u8, 78u8, + ], + vk_beta_g2: [ + 18u8, 109u8, 15u8, 5u8, 124u8, 230u8, 240u8, 142u8, 88u8, 218u8, 41u8, 208u8, 103u8, 2u8, + 31u8, 179u8, 62u8, 223u8, 112u8, 135u8, 234u8, 71u8, 10u8, 50u8, 135u8, 253u8, 240u8, + 215u8, 231u8, 138u8, 11u8, 210u8, 21u8, 222u8, 103u8, 238u8, 31u8, 215u8, 241u8, 149u8, + 208u8, 241u8, 47u8, 9u8, 134u8, 8u8, 84u8, 3u8, 103u8, 59u8, 124u8, 246u8, 250u8, 231u8, + 204u8, 8u8, 153u8, 16u8, 255u8, 75u8, 214u8, 128u8, 205u8, 9u8, 8u8, 30u8, 206u8, 167u8, + 123u8, 8u8, 33u8, 197u8, 197u8, 32u8, 144u8, 185u8, 91u8, 147u8, 13u8, 27u8, 167u8, 66u8, + 0u8, 80u8, 87u8, 125u8, 54u8, 18u8, 48u8, 232u8, 91u8, 106u8, 12u8, 62u8, 183u8, 134u8, + 28u8, 150u8, 196u8, 251u8, 232u8, 255u8, 121u8, 213u8, 140u8, 158u8, 138u8, 148u8, 50u8, + 44u8, 23u8, 77u8, 148u8, 164u8, 175u8, 229u8, 167u8, 10u8, 242u8, 82u8, 65u8, 36u8, 3u8, + 21u8, 134u8, 82u8, 139u8, 164u8, + ], + vk_gamme_g2: [ + 21u8, 235u8, 215u8, 112u8, 28u8, 68u8, 234u8, 16u8, 126u8, 61u8, 124u8, 59u8, 101u8, 99u8, + 84u8, 237u8, 226u8, 135u8, 151u8, 122u8, 235u8, 218u8, 164u8, 20u8, 94u8, 150u8, 5u8, 6u8, + 225u8, 29u8, 40u8, 198u8, 11u8, 25u8, 247u8, 115u8, 183u8, 119u8, 236u8, 94u8, 188u8, + 146u8, 15u8, 207u8, 198u8, 10u8, 236u8, 35u8, 130u8, 225u8, 103u8, 84u8, 242u8, 155u8, + 230u8, 78u8, 7u8, 175u8, 139u8, 135u8, 125u8, 222u8, 63u8, 42u8, 3u8, 71u8, 9u8, 79u8, + 110u8, 68u8, 249u8, 79u8, 149u8, 180u8, 101u8, 89u8, 185u8, 168u8, 36u8, 52u8, 88u8, 42u8, + 11u8, 152u8, 55u8, 3u8, 36u8, 120u8, 206u8, 195u8, 215u8, 89u8, 155u8, 161u8, 31u8, 187u8, + 5u8, 17u8, 132u8, 176u8, 175u8, 166u8, 143u8, 149u8, 122u8, 157u8, 202u8, 38u8, 212u8, + 163u8, 255u8, 149u8, 202u8, 122u8, 44u8, 109u8, 132u8, 139u8, 156u8, 60u8, 181u8, 176u8, + 111u8, 239u8, 38u8, 157u8, 5u8, 91u8, + ], + vk_delta_g2: [ + 13u8, 189u8, 248u8, 13u8, 209u8, 141u8, 197u8, 200u8, 129u8, 70u8, 234u8, 87u8, 206u8, + 11u8, 66u8, 16u8, 13u8, 58u8, 78u8, 150u8, 17u8, 124u8, 130u8, 79u8, 198u8, 238u8, 209u8, + 126u8, 234u8, 132u8, 7u8, 4u8, 18u8, 188u8, 254u8, 180u8, 8u8, 231u8, 8u8, 44u8, 165u8, + 70u8, 138u8, 114u8, 99u8, 89u8, 246u8, 163u8, 254u8, 168u8, 47u8, 180u8, 82u8, 146u8, + 247u8, 163u8, 93u8, 207u8, 245u8, 10u8, 107u8, 128u8, 183u8, 34u8, 8u8, 68u8, 131u8, 98u8, + 214u8, 179u8, 202u8, 170u8, 158u8, 66u8, 191u8, 34u8, 203u8, 20u8, 86u8, 199u8, 164u8, + 217u8, 163u8, 66u8, 189u8, 140u8, 140u8, 22u8, 247u8, 114u8, 233u8, 224u8, 68u8, 225u8, + 37u8, 120u8, 23u8, 188u8, 156u8, 56u8, 224u8, 38u8, 75u8, 144u8, 204u8, 151u8, 61u8, 222u8, + 16u8, 125u8, 57u8, 130u8, 7u8, 41u8, 73u8, 172u8, 55u8, 98u8, 217u8, 245u8, 106u8, 42u8, + 69u8, 190u8, 120u8, 185u8, 50u8, 58u8, + ], + vk_ic: &[ + [ + 30u8, 40u8, 115u8, 85u8, 149u8, 247u8, 121u8, 223u8, 89u8, 227u8, 34u8, 157u8, 156u8, + 118u8, 71u8, 118u8, 229u8, 203u8, 74u8, 160u8, 185u8, 224u8, 146u8, 199u8, 22u8, 219u8, + 247u8, 41u8, 194u8, 46u8, 8u8, 227u8, 24u8, 75u8, 84u8, 30u8, 198u8, 244u8, 116u8, + 24u8, 186u8, 233u8, 93u8, 24u8, 235u8, 196u8, 46u8, 69u8, 20u8, 135u8, 80u8, 187u8, + 63u8, 239u8, 42u8, 53u8, 184u8, 178u8, 195u8, 47u8, 164u8, 47u8, 226u8, 225u8, + ], + [ + 11u8, 191u8, 120u8, 10u8, 130u8, 255u8, 181u8, 122u8, 225u8, 162u8, 178u8, 125u8, 66u8, + 64u8, 137u8, 221u8, 158u8, 126u8, 209u8, 223u8, 133u8, 240u8, 98u8, 67u8, 90u8, 186u8, + 243u8, 198u8, 174u8, 233u8, 33u8, 57u8, 18u8, 198u8, 218u8, 209u8, 2u8, 176u8, 193u8, + 151u8, 37u8, 129u8, 132u8, 70u8, 102u8, 1u8, 194u8, 167u8, 61u8, 59u8, 206u8, 55u8, + 246u8, 54u8, 116u8, 56u8, 96u8, 144u8, 23u8, 19u8, 204u8, 228u8, 187u8, 159u8, + ], + [ + 29u8, 76u8, 17u8, 165u8, 146u8, 25u8, 163u8, 122u8, 73u8, 53u8, 148u8, 54u8, 26u8, + 230u8, 60u8, 26u8, 30u8, 94u8, 188u8, 65u8, 136u8, 80u8, 20u8, 154u8, 201u8, 145u8, + 252u8, 172u8, 222u8, 188u8, 251u8, 90u8, 47u8, 118u8, 232u8, 191u8, 89u8, 179u8, 252u8, + 174u8, 143u8, 40u8, 34u8, 173u8, 93u8, 151u8, 17u8, 201u8, 50u8, 61u8, 90u8, 241u8, + 115u8, 4u8, 127u8, 202u8, 104u8, 195u8, 70u8, 212u8, 134u8, 26u8, 130u8, 15u8, + ], + [ + 46u8, 220u8, 85u8, 202u8, 81u8, 44u8, 228u8, 127u8, 223u8, 254u8, 12u8, 192u8, 106u8, + 76u8, 251u8, 193u8, 108u8, 65u8, 126u8, 48u8, 128u8, 171u8, 26u8, 92u8, 93u8, 242u8, + 84u8, 128u8, 230u8, 68u8, 102u8, 128u8, 42u8, 114u8, 219u8, 143u8, 188u8, 139u8, 15u8, + 53u8, 230u8, 251u8, 143u8, 210u8, 118u8, 91u8, 166u8, 113u8, 106u8, 168u8, 246u8, + 168u8, 222u8, 159u8, 64u8, 28u8, 224u8, 232u8, 164u8, 184u8, 25u8, 72u8, 18u8, 199u8, + ], + [ + 13u8, 241u8, 130u8, 32u8, 96u8, 173u8, 147u8, 60u8, 79u8, 13u8, 113u8, 104u8, 57u8, + 14u8, 72u8, 100u8, 222u8, 106u8, 255u8, 193u8, 79u8, 58u8, 205u8, 95u8, 221u8, 41u8, + 231u8, 77u8, 43u8, 123u8, 48u8, 247u8, 33u8, 160u8, 102u8, 141u8, 166u8, 168u8, 70u8, + 206u8, 65u8, 128u8, 61u8, 255u8, 40u8, 107u8, 107u8, 0u8, 73u8, 57u8, 49u8, 153u8, + 116u8, 128u8, 97u8, 252u8, 117u8, 82u8, 97u8, 154u8, 125u8, 54u8, 234u8, 207u8, + ], + [ + 21u8, 187u8, 76u8, 210u8, 177u8, 72u8, 188u8, 93u8, 126u8, 172u8, 36u8, 233u8, 103u8, + 187u8, 33u8, 199u8, 13u8, 193u8, 51u8, 232u8, 21u8, 137u8, 50u8, 235u8, 48u8, 39u8, + 51u8, 60u8, 115u8, 196u8, 206u8, 29u8, 33u8, 92u8, 252u8, 117u8, 23u8, 116u8, 114u8, + 7u8, 71u8, 74u8, 245u8, 181u8, 184u8, 223u8, 216u8, 150u8, 70u8, 67u8, 109u8, 105u8, + 138u8, 94u8, 89u8, 212u8, 226u8, 112u8, 61u8, 155u8, 106u8, 99u8, 92u8, 17u8, + ], + [ + 6u8, 158u8, 86u8, 149u8, 16u8, 238u8, 64u8, 3u8, 47u8, 181u8, 107u8, 37u8, 189u8, 12u8, + 9u8, 182u8, 53u8, 56u8, 141u8, 196u8, 19u8, 113u8, 61u8, 226u8, 67u8, 53u8, 178u8, + 229u8, 110u8, 109u8, 242u8, 250u8, 14u8, 142u8, 239u8, 50u8, 38u8, 61u8, 190u8, 225u8, + 82u8, 47u8, 137u8, 166u8, 148u8, 47u8, 152u8, 183u8, 237u8, 110u8, 158u8, 59u8, 108u8, + 117u8, 131u8, 59u8, 230u8, 252u8, 58u8, 135u8, 37u8, 162u8, 176u8, 248u8, + ], + [ + 2u8, 46u8, 1u8, 211u8, 67u8, 34u8, 196u8, 52u8, 212u8, 79u8, 228u8, 152u8, 61u8, 233u8, + 155u8, 62u8, 180u8, 36u8, 226u8, 231u8, 17u8, 31u8, 38u8, 206u8, 208u8, 85u8, 52u8, + 13u8, 213u8, 191u8, 165u8, 103u8, 15u8, 114u8, 215u8, 89u8, 247u8, 137u8, 141u8, 110u8, + 159u8, 58u8, 138u8, 26u8, 98u8, 130u8, 179u8, 197u8, 151u8, 56u8, 245u8, 68u8, 158u8, + 28u8, 148u8, 56u8, 117u8, 242u8, 22u8, 170u8, 121u8, 161u8, 124u8, 102u8, + ], + [ + 14u8, 134u8, 7u8, 130u8, 139u8, 206u8, 77u8, 220u8, 145u8, 15u8, 214u8, 228u8, 250u8, + 121u8, 138u8, 55u8, 40u8, 238u8, 2u8, 196u8, 83u8, 93u8, 94u8, 250u8, 227u8, 235u8, + 116u8, 117u8, 66u8, 132u8, 139u8, 221u8, 42u8, 11u8, 45u8, 129u8, 68u8, 81u8, 218u8, + 158u8, 180u8, 187u8, 194u8, 123u8, 63u8, 127u8, 47u8, 163u8, 219u8, 14u8, 0u8, 154u8, + 69u8, 153u8, 103u8, 249u8, 87u8, 234u8, 156u8, 212u8, 123u8, 186u8, 254u8, 232u8, + ], + [ + 27u8, 138u8, 177u8, 119u8, 91u8, 43u8, 249u8, 187u8, 242u8, 25u8, 69u8, 225u8, 35u8, + 213u8, 76u8, 150u8, 106u8, 249u8, 127u8, 198u8, 94u8, 147u8, 51u8, 151u8, 71u8, 216u8, + 229u8, 186u8, 216u8, 231u8, 198u8, 60u8, 36u8, 151u8, 241u8, 136u8, 75u8, 113u8, 159u8, + 73u8, 244u8, 66u8, 207u8, 132u8, 215u8, 55u8, 8u8, 29u8, 164u8, 153u8, 137u8, 52u8, + 165u8, 147u8, 23u8, 229u8, 37u8, 221u8, 187u8, 120u8, 167u8, 225u8, 97u8, 180u8, + ], + [ + 30u8, 75u8, 129u8, 210u8, 198u8, 80u8, 90u8, 101u8, 137u8, 19u8, 153u8, 193u8, 141u8, + 138u8, 11u8, 114u8, 218u8, 111u8, 187u8, 154u8, 17u8, 142u8, 220u8, 217u8, 45u8, 193u8, + 143u8, 219u8, 34u8, 229u8, 207u8, 113u8, 31u8, 38u8, 203u8, 97u8, 38u8, 228u8, 27u8, + 16u8, 163u8, 159u8, 80u8, 23u8, 128u8, 40u8, 185u8, 119u8, 55u8, 12u8, 54u8, 2u8, + 126u8, 185u8, 86u8, 132u8, 200u8, 149u8, 19u8, 51u8, 229u8, 37u8, 179u8, 95u8, + ], + [ + 46u8, 176u8, 193u8, 87u8, 212u8, 137u8, 81u8, 105u8, 114u8, 111u8, 209u8, 32u8, 10u8, + 121u8, 166u8, 187u8, 115u8, 63u8, 184u8, 235u8, 68u8, 229u8, 216u8, 166u8, 251u8, + 238u8, 155u8, 99u8, 14u8, 161u8, 2u8, 117u8, 23u8, 176u8, 8u8, 247u8, 121u8, 180u8, + 25u8, 124u8, 29u8, 151u8, 123u8, 222u8, 26u8, 179u8, 125u8, 155u8, 77u8, 47u8, 88u8, + 167u8, 33u8, 65u8, 128u8, 207u8, 199u8, 224u8, 104u8, 155u8, 11u8, 1u8, 126u8, 28u8, + ], + [ + 40u8, 114u8, 239u8, 136u8, 189u8, 135u8, 200u8, 213u8, 135u8, 67u8, 164u8, 148u8, + 179u8, 228u8, 28u8, 142u8, 175u8, 76u8, 6u8, 214u8, 103u8, 228u8, 96u8, 155u8, 160u8, + 240u8, 18u8, 224u8, 144u8, 1u8, 239u8, 218u8, 10u8, 62u8, 127u8, 181u8, 72u8, 24u8, + 57u8, 250u8, 184u8, 212u8, 49u8, 250u8, 163u8, 191u8, 144u8, 249u8, 47u8, 179u8, 203u8, + 31u8, 160u8, 213u8, 120u8, 37u8, 210u8, 82u8, 37u8, 175u8, 78u8, 60u8, 34u8, 156u8, + ], + [ + 46u8, 235u8, 77u8, 202u8, 133u8, 140u8, 37u8, 11u8, 140u8, 223u8, 144u8, 22u8, 1u8, + 65u8, 132u8, 47u8, 152u8, 157u8, 197u8, 184u8, 181u8, 112u8, 60u8, 130u8, 21u8, 250u8, + 170u8, 49u8, 229u8, 189u8, 177u8, 184u8, 47u8, 140u8, 53u8, 120u8, 100u8, 19u8, 140u8, + 150u8, 19u8, 113u8, 3u8, 165u8, 187u8, 150u8, 9u8, 192u8, 31u8, 66u8, 235u8, 7u8, 52u8, + 225u8, 107u8, 45u8, 194u8, 164u8, 145u8, 183u8, 118u8, 17u8, 201u8, 200u8, + ], + [ + 20u8, 239u8, 193u8, 161u8, 77u8, 41u8, 237u8, 254u8, 96u8, 202u8, 124u8, 217u8, 188u8, + 47u8, 190u8, 139u8, 26u8, 105u8, 121u8, 159u8, 150u8, 55u8, 68u8, 14u8, 70u8, 111u8, + 33u8, 90u8, 221u8, 44u8, 119u8, 123u8, 3u8, 251u8, 84u8, 237u8, 38u8, 20u8, 202u8, + 143u8, 221u8, 190u8, 214u8, 218u8, 71u8, 141u8, 108u8, 1u8, 152u8, 254u8, 183u8, 211u8, + 222u8, 84u8, 12u8, 87u8, 28u8, 113u8, 249u8, 212u8, 25u8, 204u8, 48u8, 195u8, + ], + [ + 8u8, 53u8, 40u8, 147u8, 112u8, 58u8, 153u8, 180u8, 89u8, 144u8, 76u8, 245u8, 86u8, + 167u8, 214u8, 233u8, 88u8, 30u8, 163u8, 166u8, 188u8, 195u8, 169u8, 62u8, 4u8, 61u8, + 219u8, 210u8, 113u8, 174u8, 27u8, 26u8, 11u8, 105u8, 66u8, 188u8, 228u8, 166u8, 9u8, + 64u8, 172u8, 178u8, 167u8, 62u8, 245u8, 104u8, 79u8, 226u8, 11u8, 27u8, 160u8, 64u8, + 152u8, 170u8, 172u8, 251u8, 92u8, 109u8, 93u8, 145u8, 15u8, 156u8, 220u8, 6u8, + ], + [ + 45u8, 57u8, 28u8, 162u8, 250u8, 89u8, 35u8, 101u8, 194u8, 114u8, 36u8, 126u8, 184u8, + 11u8, 236u8, 186u8, 97u8, 217u8, 71u8, 86u8, 235u8, 162u8, 60u8, 220u8, 146u8, 97u8, + 6u8, 247u8, 46u8, 98u8, 125u8, 228u8, 4u8, 160u8, 121u8, 45u8, 236u8, 108u8, 164u8, + 26u8, 122u8, 119u8, 37u8, 47u8, 231u8, 200u8, 90u8, 252u8, 54u8, 58u8, 207u8, 191u8, + 48u8, 228u8, 69u8, 35u8, 178u8, 59u8, 29u8, 89u8, 65u8, 83u8, 156u8, 179u8, + ], + ], +};