Skip to content

Commit

Permalink
chore: Update prepare script to use arkzkey
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarth committed Dec 6, 2023
1 parent fad791e commit 4591653
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scripts/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ fi

PROJECT_DIR=$(pwd)
CIRCOM_DIR="${PROJECT_DIR}/mopro-core/examples/circom"
ARKZKEY_DIR="${PROJECT_DIR}/ark-zkey"

compile_circuit() {
local circuit_dir=$1
Expand Down Expand Up @@ -70,6 +71,16 @@ check_target_support() {
rustup target list | grep installed | grep -q "$1"
}

# Install arkzkey-util binary in ark-zkey
cd $ARKZKEY_DIR
print_action "[ark-zkey] Installing arkzkey-util..."
if ! command -v arkzkey-util &> /dev/null
then
cargo install --bin arkzkey-util --path .
else
echo "arkzkey-util already installed, skipping."
fi

# Build Circom circuits in mopro-core and run trusted setup
print_action "[core/circom] Compiling example circuits..."
cd $CIRCOM_DIR
Expand All @@ -89,14 +100,26 @@ compile_circuit rsa main.circom
print_action "[core/circom] Running trusted setup for multiplier2..."
./scripts/trusted_setup.sh multiplier2 08 multiplier2

# Generate arkzkey for multipler2
print_action "[core/circom] Generating arkzkey for multiplier2..."
arkzkey-util multiplier2/target/multiplier2_final.zkey

# Run trusted setup for keccak256
print_action "[core/circom] Running trusted setup for keccak256..."
./scripts/trusted_setup.sh keccak256 18 keccak256_256_test

# Generate arkzkey for keccak256
print_action "[core/circom] Generating arkzkey for keccak256..."
arkzkey-util keccak256/target/keccak256_256_test_final.zkey

# Run trusted setup for rsa
print_action "[core/circom] Running trusted setup for rsa..."
./scripts/trusted_setup.sh rsa 18 main

# Generate arkzkey for rsa
print_action "[core/circom] Generating arkzkey for rsa..."
arkzkey-util rsa/target/main_final.zkey

# Add support for target architectures
print_action "[ffi] Adding support for target architectures..."
cd ${PROJECT_DIR}/mopro-ffi
Expand Down

0 comments on commit 4591653

Please sign in to comment.