mirror of
https://github.com/AtHeartEngineer/spartan-ecdsa.git
synced 2026-01-09 05:18:01 -05:00
Add scripts to compile addr_membership and pubkey_membership
This commit is contained in:
2
scripts/addr_membership_circuit.sh
Normal file
2
scripts/addr_membership_circuit.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
sh ./scripts/compile_circuit.sh addr_membership 5
|
||||
15
scripts/compile_circuit.sh
Normal file
15
scripts/compile_circuit.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
CIRCUIT_NAME=$1
|
||||
NUM_PUB_INPUTS=$2
|
||||
|
||||
BUILD_DIR=./packages/circuits/build/$CIRCUIT_NAME
|
||||
mkdir -p $BUILD_DIR &&
|
||||
circom ./packages/circuits/instances/$CIRCUIT_NAME.circom --r1cs --wasm --prime secq256k1 -o $BUILD_DIR &&
|
||||
|
||||
# Compile circom r1cs into binary
|
||||
cargo run --release --bin gen_spartan_inst $BUILD_DIR/$CIRCUIT_NAME.r1cs $BUILD_DIR/$CIRCUIT_NAME.circuit $NUM_PUB_INPUTS &&
|
||||
|
||||
# Copy the circuit into the lib dir
|
||||
LIB_CIRCUITS_DIR=./packages/lib/src/circuits
|
||||
mkdir -p $LIB_CIRCUITS_DIR &&
|
||||
cp $BUILD_DIR/*_js/*.wasm $LIB_CIRCUITS_DIR &&
|
||||
cp $BUILD_DIR/*.circuit $LIB_CIRCUITS_DIR
|
||||
@@ -1,11 +0,0 @@
|
||||
BUILD_DIR=./packages/circuits/build/eff_ecdsa
|
||||
mkdir -p $BUILD_DIR &&
|
||||
circom ./packages/circuits/instances/eff_ecdsa.circom --r1cs --wasm --prime secq256k1 -o $BUILD_DIR &&
|
||||
|
||||
# Copy the circuit into the lib dir
|
||||
LIB_CIRCUITS_DIR=./packages/lib/src/circuits
|
||||
mkdir -p $LIB_CIRCUITS_DIR &&
|
||||
cp $BUILD_DIR/*_js/*.wasm $LIB_CIRCUITS_DIR &&
|
||||
cp $BUILD_DIR/*.circuit $LIB_CIRCUITS_DIR &&
|
||||
|
||||
cargo run --bin gen_spartan_inst $BUILD_DIR/eff_ecdsa.r1cs $BUILD_DIR/eff_ecdsa.circuit 4
|
||||
@@ -1,4 +0,0 @@
|
||||
BUILD_DIR=./packages/circuits/build/eff_ecdsa_to_addr
|
||||
mkdir -p $BUILD_DIR &&
|
||||
circom ./packages/circuits/instances/eff_ecdsa_to_addr.circom --r1cs --wasm --prime secq256k1 -o $BUILD_DIR &&
|
||||
cargo run --release --bin gen_spartan_inst $BUILD_DIR/eff_ecdsa_to_addr.r1cs $BUILD_DIR/eff_ecdsa_to_addr.circuit 4
|
||||
@@ -1,11 +0,0 @@
|
||||
BUILD_DIR=./packages/circuits/build/membership
|
||||
mkdir -p $BUILD_DIR &&
|
||||
circom ./packages/circuits/instances/membership.circom --r1cs --wasm --prime secq256k1 -o $BUILD_DIR &&
|
||||
|
||||
# Copy the circuit into the lib dir
|
||||
LIB_CIRCUITS_DIR=./packages/lib/src/circuits
|
||||
mkdir -p $LIB_CIRCUITS_DIR &&
|
||||
cp $BUILD_DIR/*_js/*.wasm $LIB_CIRCUITS_DIR &&
|
||||
cp $BUILD_DIR/*.circuit $LIB_CIRCUITS_DIR &&
|
||||
|
||||
cargo run --release --bin gen_spartan_inst $BUILD_DIR/membership.r1cs $BUILD_DIR/membership.circuit 4
|
||||
2
scripts/pubkey_membership_circuit.sh
Normal file
2
scripts/pubkey_membership_circuit.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
sh ./scripts/compile_circuit.sh pubkey_membership 5
|
||||
Reference in New Issue
Block a user