Skip to content

Commit e3ead5e

Browse files
committed
feat: initialize circom project with multiplexer circuit and build scripts
- Added .gitignore to exclude output directory - Created package.json and package-lock.json for dependency management - Implemented multiplexer circuit in multiplexer.circom - Added build script for compiling circuits and generating proof parameters - Included test vectors for multiplexer in the circom-prover
1 parent 16c1ce4 commit e3ead5e

File tree

8 files changed

+429
-7
lines changed

8 files changed

+429
-7
lines changed

circom-prover/src/lib.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,12 @@ mod tests {
7575
#[cfg(all(feature = "rustwitness", feature = "arkworks"))]
7676
#[test]
7777
fn test_rustwitness_arkworks_bls12_381_prove_and_verify() {
78-
rust_witness::witness!(multiplier2bls);
79-
let inputs = HashMap::from([
80-
("a".to_string(), vec!["1".to_string()]),
81-
("b".to_string(), vec!["2".to_string()]),
82-
]);
83-
let zkey_path = "./test-vectors/multiplier2_bls.zkey";
78+
rust_witness::witness!(multiplexer);
79+
let inputs = HashMap::from([("in".to_string(), vec!["42".to_string()])]);
80+
let zkey_path = "./test-vectors/multiplexer_final.zkey";
8481
let input_str = serde_json::to_string(&inputs).unwrap();
8582
let proof_lib = ProofLib::Arkworks;
86-
let witness_fn = WitnessFn::RustWitness(multiplier2bls_witness);
83+
let witness_fn = WitnessFn::RustWitness(multiplexer_witness);
8784
let proof =
8885
CircomProver::prove(proof_lib, witness_fn, input_str, zkey_path.to_string()).unwrap();
8986
let valid = CircomProver::verify(proof_lib, proof, zkey_path.to_string()).unwrap();
33.5 KB
Binary file not shown.
3.57 KB
Binary file not shown.

circom/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
out/

circom/circuits/multiplexer.circom

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pragma circom 2.1.9;
2+
3+
template Demo() {
4+
signal input in;
5+
signal output out;
6+
7+
signal x <-- 1;
8+
out <== in * x;
9+
}
10+
component main = Demo();

0 commit comments

Comments
 (0)