from "EMBED" import snark_verify_bls12_377;

// Verifies a proof with 2 public inputs (1 input + 1 output)
// Circuit used in this test:
//
// def main(field a) -> field {
//     return a * a;
// }
//
// Save the circuit as "circuit.zok" and run the following commands (in order):
// $ zokrates compile -i ./circuit.zok -c bls12_377
// $ zokrates compute-witness -a 2
// $ zokrates setup -b ark -s gm17
// $ zokrates generate-proof -b ark -s gm17
//
// To get flattened inputs needed for this test, use the following script:
// #!/usr/bin/env node
//
// const path = require("path");
// const fs = require("fs");
//
// let output = []
// for (let i = 2; i < process.argv.length; i++) {
//     const source = fs.readFileSync(path.resolve(process.argv[i]), 'utf8')
//     const flat = [...source.matchAll(/0x[a-z0-9]+/gm)].map(n => BigInt(n).toString(10));
//     output.push(...flat)
// }
//
// console.log(JSON.stringify(output));
//
// Save this script as "flatten.js" and run the following command:
// $ node flatten.js proof.json verification.key

def main(private field[8] proof, private field[2] inputs, private field[22] vk) -> bool {
    bool result = snark_verify_bls12_377(inputs, proof, vk);
    return result;
}
