mirror of
https://github.com/personaelabs/spartan-ecdsa.git
synced 2026-01-09 14:07:54 -05:00
Add bin file to compile Circom circuit to spartan circuit
This commit is contained in:
11
Cargo.toml
11
Cargo.toml
@@ -19,6 +19,12 @@ web-sys = { version = "0.3.60", features = ["console"] }
|
||||
serde_json = "1.0.89"
|
||||
libsecp256k1 = "0.7.1"
|
||||
num-bigint = "0.4.3"
|
||||
serde = "1.0.151"
|
||||
byteorder = "1.4.3"
|
||||
ff = "0.12.0"
|
||||
pasta_curves = "0.4.0"
|
||||
serde-wasm-bindgen = "0.4.5"
|
||||
|
||||
|
||||
[target.'cfg(not(target_family = "wasm"))'.dependencies]
|
||||
nova-scotia = { git = "https://github.com/nalinbhardwaj/Nova-Scotia.git" }
|
||||
@@ -31,3 +37,8 @@ wasm-bindgen-rayon = { version = "1.0"}
|
||||
|
||||
[dependencies.getrandom]
|
||||
features = ["js"]
|
||||
|
||||
|
||||
[[bin]]
|
||||
name = "gen_spartan_inst"
|
||||
path = "src/bin/gen_spartan_inst.rs"
|
||||
|
||||
18
src/bin/gen_spartan_inst.rs
Normal file
18
src/bin/gen_spartan_inst.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
use serde_json::json;
|
||||
use spartan_wasm::circuits::utils::load_as_spartan_inst;
|
||||
use std::env::current_dir;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
|
||||
fn main() {
|
||||
let root = current_dir().unwrap();
|
||||
let circuit_file = root.join("circuits/build/poseidon/poseidon.r1cs");
|
||||
let spartan_inst = load_as_spartan_inst(circuit_file, 0);
|
||||
let spartan_inst_json = json!(spartan_inst);
|
||||
|
||||
let output_file = root.join("browser_benchmark/public/poseidon_circuit.json");
|
||||
File::create(output_file)
|
||||
.unwrap()
|
||||
.write_all(spartan_inst_json.to_string().as_bytes())
|
||||
.unwrap();
|
||||
}
|
||||
Reference in New Issue
Block a user