Skip to content

Instantly share code, notes, and snippets.

@shekohex
Created September 27, 2023 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shekohex/e85475578b870e38e9c4ad1058696568 to your computer and use it in GitHub Desktop.
Save shekohex/e85475578b870e38e9c4ad1058696568 to your computer and use it in GitHub Desktop.
Extended Witness using ark-circom
#[test]
fn extended_witness_circom2() -> Result<()> {
use std::collections::HashMap;
use ark_circom::WitnessCalculator;
let mut wtns = WitnessCalculator::new("./test-vectors/circom2_multiplier2.wasm").unwrap();
let inputs = HashMap::from([
(String::from("a"), vec![4.into()]),
(String::from("b"), vec![5.into()]),
]);
let sanity_check = true;
// calculate the witness
let witness = wtns.calculate_witness_element::<Bn254, _>(inputs, sanity_check)?;
eprintln!("witness: {:?}", witness);
Ok(())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment