Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions circuits/benchmarks/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"circuits": [
"config",
"dkg/pk",
"dkg/sk_share_computation",
"dkg/e_sm_share_computation",
Expand Down
158 changes: 86 additions & 72 deletions circuits/benchmarks/results_insecure/report.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Enclave ZK Circuit Benchmarks

**Generated:** 2026-02-13 12:59:43 UTC
**Generated:** 2026-02-17 15:08:16 UTC

**Git Branch:** `ref/circuits-comp`
**Git Commit:** `2403461592f5c628cb22b493586995f79bb698e1`
**Git Branch:** `configs/fixqmt`
**Git Commit:** `689e56cb90251b34e67af87cb7abfed03bedcd1c`

---

Expand All @@ -15,43 +15,55 @@

| Circuit | Compile | Execute | Prove | Verify |
| ---------------------- | ------- | ------- | ------ | ------ |
| e_sm_share_computation | 0.31 s | 0.52 s | 1.55 s | 0.02 s |
| pk | 0.25 s | 0.27 s | 0.12 s | 0.03 s |
| share_decryption | 0.25 s | 0.29 s | 0.23 s | 0.02 s |
| share_encryption | 0.29 s | 0.44 s | 0.61 s | 0.03 s |
| sk_share_computation | 0.30 s | 0.51 s | 1.54 s | 0.03 s |
| e_sm_share_computation | 3.29 s | 0.54 s | 1.63 s | 0.03 s |
| pk | 0.33 s | 0.26 s | 0.12 s | 0.02 s |
| share_decryption | 0.71 s | 0.29 s | 0.23 s | 0.02 s |
| share_encryption | 1.99 s | 0.43 s | 0.62 s | 0.03 s |
| sk_share_computation | 3.18 s | 0.51 s | 1.62 s | 0.02 s |

#### Size & Circuit Metrics

| Circuit | Opcodes | Gates | Circuit Size | Witness | VK Size | Proof Size |
| ---------------------- | ------- | ------- | ------------ | --------- | ------- | ---------- |
| e_sm_share_computation | 90956 | 328.74K | 1.39 MB | 477.72 KB | 3.59 KB | 15.88 KB |
| pk | 344 | 6.85K | 87.84 KB | 29.07 KB | 3.59 KB | 15.88 KB |
| share_decryption | 3093 | 28.72K | 158.27 KB | 148.91 KB | 3.59 KB | 15.88 KB |
| share_encryption | 47758 | 127.69K | 798.14 KB | 512.11 KB | 3.59 KB | 15.88 KB |
| sk_share_computation | 90827 | 326.14K | 1.38 MB | 463.68 KB | 3.59 KB | 15.88 KB |
| e_sm_share_computation | 90956 | 328.74K | 1.39 MB | 477.88 KB | 3.59 KB | 15.88 KB |
| pk | 344 | 6.85K | 87.84 KB | 29.08 KB | 3.59 KB | 15.88 KB |
| share_decryption | 3093 | 28.72K | 158.27 KB | 148.90 KB | 3.59 KB | 15.88 KB |
| share_encryption | 47758 | 127.69K | 798.14 KB | 512.29 KB | 3.59 KB | 15.88 KB |
| sk_share_computation | 90827 | 326.14K | 1.38 MB | 463.75 KB | 3.59 KB | 15.88 KB |

### Threshold

#### Timing Metrics

| Circuit | Compile | Execute | Prove | Verify |
| -------------------------------- | ------- | ------- | ------ | ------ |
| decrypted_shares_aggregation_mod | 0.27 s | 0.33 s | 0.46 s | 0.02 s |
| pk_aggregation | 0.29 s | 0.45 s | 0.87 s | 0.02 s |
| pk_generation | 0.28 s | 0.38 s | 0.48 s | 0.03 s |
| share_decryption | 0.28 s | 0.40 s | 0.53 s | 0.03 s |
| user_data_encryption | 0.30 s | 0.47 s | 0.58 s | 0.02 s |
| decrypted_shares_aggregation_mod | 0.54 s | 0.32 s | 0.47 s | 0.03 s |
| pk_aggregation | 1.45 s | 0.43 s | 0.88 s | 0.02 s |
| pk_generation | 1.24 s | 0.37 s | 0.50 s | 0.03 s |
| share_decryption | 1.18 s | 0.37 s | 0.52 s | 0.03 s |
| user_data_encryption | 2.01 s | 0.47 s | 0.61 s | 0.02 s |

#### Size & Circuit Metrics

| Circuit | Opcodes | Gates | Circuit Size | Witness | VK Size | Proof Size |
| -------------------------------- | ------- | ------- | ------------ | --------- | ------- | ---------- |
| decrypted_shares_aggregation_mod | 31544 | 80.74K | 509.84 KB | 77.56 KB | 3.59 KB | 15.88 KB |
| pk_aggregation | 47817 | 169.89K | 884.11 KB | 360.86 KB | 3.59 KB | 15.88 KB |
| pk_generation | 30019 | 65.61K | 542.16 KB | 447.05 KB | 3.59 KB | 15.88 KB |
| share_decryption | 30570 | 85.48K | 541.56 KB | 522.86 KB | 3.59 KB | 15.88 KB |
| user_data_encryption | 56601 | 106.72K | 847.64 KB | 691.13 KB | 3.59 KB | 15.88 KB |
| decrypted_shares_aggregation_mod | 31544 | 80.74K | 509.84 KB | 77.50 KB | 3.59 KB | 15.88 KB |
| pk_aggregation | 47817 | 169.89K | 884.11 KB | 360.70 KB | 3.59 KB | 15.88 KB |
| pk_generation | 30019 | 65.61K | 542.16 KB | 446.98 KB | 3.59 KB | 15.88 KB |
| share_decryption | 22378 | 74.21K | 460.26 KB | 494.32 KB | 3.59 KB | 15.88 KB |
| user_data_encryption | 56601 | 106.72K | 847.53 KB | 691.33 KB | 3.59 KB | 15.88 KB |

### Config

#### Timing Metrics

| Circuit | Compile | Execute | Prove | Verify |
| ------- | ------- | ------- | ----- | ------ |

#### Size & Circuit Metrics

| Circuit | Opcodes | Gates | Circuit Size | Witness | VK Size | Proof Size |
| ------- | ------- | ----- | ------------ | ------- | ------- | ---------- |

## Circuit Details

Expand All @@ -61,79 +73,79 @@

| Metric | Value |
| -------------------- | --------- |
| **Compilation** | 0.31 s |
| **Execution** | 0.52 s |
| **VK Generation** | 0.59 s |
| **Proof Generation** | 1.55 s |
| **Verification** | 0.02 s |
| **Compilation** | 3.29 s |
| **Execution** | 0.54 s |
| **VK Generation** | 0.64 s |
| **Proof Generation** | 1.63 s |
| **Verification** | 0.03 s |
| **ACIR Opcodes** | "90956" |
| **Total Gates** | "328743" |
| **Circuit Size** | 1.39 MB |
| **Witness Size** | 477.72 KB |
| **Witness Size** | 477.88 KB |
| **VK Size** | 3.59 KB |
| **Proof Size** | 15.88 KB |

#### pk

| Metric | Value |
| -------------------- | -------- |
| **Compilation** | 0.25 s |
| **Execution** | 0.27 s |
| **Compilation** | 0.33 s |
| **Execution** | 0.26 s |
| **VK Generation** | 0.05 s |
| **Proof Generation** | 0.12 s |
| **Verification** | 0.03 s |
| **Verification** | 0.02 s |
| **ACIR Opcodes** | "344" |
| **Total Gates** | "6846" |
| **Circuit Size** | 87.84 KB |
| **Witness Size** | 29.07 KB |
| **Witness Size** | 29.08 KB |
| **VK Size** | 3.59 KB |
| **Proof Size** | 15.88 KB |

#### share_decryption

| Metric | Value |
| -------------------- | --------- |
| **Compilation** | 0.25 s |
| **Compilation** | 0.71 s |
| **Execution** | 0.29 s |
| **VK Generation** | 0.09 s |
| **Proof Generation** | 0.23 s |
| **Verification** | 0.02 s |
| **ACIR Opcodes** | "3093" |
| **Total Gates** | "28720" |
| **Circuit Size** | 158.27 KB |
| **Witness Size** | 148.91 KB |
| **Witness Size** | 148.90 KB |
| **VK Size** | 3.59 KB |
| **Proof Size** | 15.88 KB |

#### share_encryption

| Metric | Value |
| -------------------- | --------- |
| **Compilation** | 0.29 s |
| **Execution** | 0.44 s |
| **Compilation** | 1.99 s |
| **Execution** | 0.43 s |
| **VK Generation** | 0.26 s |
| **Proof Generation** | 0.61 s |
| **Proof Generation** | 0.62 s |
| **Verification** | 0.03 s |
| **ACIR Opcodes** | "47758" |
| **Total Gates** | "127691" |
| **Circuit Size** | 798.14 KB |
| **Witness Size** | 512.11 KB |
| **Witness Size** | 512.29 KB |
| **VK Size** | 3.59 KB |
| **Proof Size** | 15.88 KB |

#### sk_share_computation

| Metric | Value |
| -------------------- | --------- |
| **Compilation** | 0.30 s |
| **Compilation** | 3.18 s |
| **Execution** | 0.51 s |
| **VK Generation** | 0.66 s |
| **Proof Generation** | 1.54 s |
| **Verification** | 0.03 s |
| **VK Generation** | 0.60 s |
| **Proof Generation** | 1.62 s |
| **Verification** | 0.02 s |
| **ACIR Opcodes** | "90827" |
| **Total Gates** | "326138" |
| **Circuit Size** | 1.38 MB |
| **Witness Size** | 463.68 KB |
| **Witness Size** | 463.75 KB |
| **VK Size** | 3.59 KB |
| **Proof Size** | 15.88 KB |

Expand All @@ -143,82 +155,84 @@

| Metric | Value |
| -------------------- | --------- |
| **Compilation** | 0.27 s |
| **Execution** | 0.33 s |
| **VK Generation** | 0.18 s |
| **Proof Generation** | 0.46 s |
| **Verification** | 0.02 s |
| **Compilation** | 0.54 s |
| **Execution** | 0.32 s |
| **VK Generation** | 0.19 s |
| **Proof Generation** | 0.47 s |
| **Verification** | 0.03 s |
| **ACIR Opcodes** | "31544" |
| **Total Gates** | "80740" |
| **Circuit Size** | 509.84 KB |
| **Witness Size** | 77.56 KB |
| **Witness Size** | 77.50 KB |
| **VK Size** | 3.59 KB |
| **Proof Size** | 15.88 KB |

#### pk_aggregation

| Metric | Value |
| -------------------- | --------- |
| **Compilation** | 0.29 s |
| **Execution** | 0.45 s |
| **Compilation** | 1.45 s |
| **Execution** | 0.43 s |
| **VK Generation** | 0.35 s |
| **Proof Generation** | 0.87 s |
| **Proof Generation** | 0.88 s |
| **Verification** | 0.02 s |
| **ACIR Opcodes** | "47817" |
| **Total Gates** | "169890" |
| **Circuit Size** | 884.11 KB |
| **Witness Size** | 360.86 KB |
| **Witness Size** | 360.70 KB |
| **VK Size** | 3.59 KB |
| **Proof Size** | 15.88 KB |

#### pk_generation

| Metric | Value |
| -------------------- | --------- |
| **Compilation** | 0.28 s |
| **Execution** | 0.38 s |
| **VK Generation** | 0.16 s |
| **Proof Generation** | 0.48 s |
| **Compilation** | 1.24 s |
| **Execution** | 0.37 s |
| **VK Generation** | 0.17 s |
| **Proof Generation** | 0.50 s |
| **Verification** | 0.03 s |
| **ACIR Opcodes** | "30019" |
| **Total Gates** | "65606" |
| **Circuit Size** | 542.16 KB |
| **Witness Size** | 447.05 KB |
| **Witness Size** | 446.98 KB |
| **VK Size** | 3.59 KB |
| **Proof Size** | 15.88 KB |

#### share_decryption

| Metric | Value |
| -------------------- | --------- |
| **Compilation** | 0.28 s |
| **Execution** | 0.40 s |
| **VK Generation** | 0.19 s |
| **Proof Generation** | 0.53 s |
| **Compilation** | 1.18 s |
| **Execution** | 0.37 s |
| **VK Generation** | 0.17 s |
| **Proof Generation** | 0.52 s |
| **Verification** | 0.03 s |
| **ACIR Opcodes** | "30570" |
| **Total Gates** | "85478" |
| **Circuit Size** | 541.56 KB |
| **Witness Size** | 522.86 KB |
| **ACIR Opcodes** | "22378" |
| **Total Gates** | "74214" |
| **Circuit Size** | 460.26 KB |
| **Witness Size** | 494.32 KB |
| **VK Size** | 3.59 KB |
| **Proof Size** | 15.88 KB |

#### user_data_encryption

| Metric | Value |
| -------------------- | --------- |
| **Compilation** | 0.30 s |
| **Compilation** | 2.01 s |
| **Execution** | 0.47 s |
| **VK Generation** | 0.23 s |
| **Proof Generation** | 0.58 s |
| **VK Generation** | 0.24 s |
| **Proof Generation** | 0.61 s |
| **Verification** | 0.02 s |
| **ACIR Opcodes** | "56601" |
| **Total Gates** | "106725" |
| **Circuit Size** | 847.64 KB |
| **Witness Size** | 691.13 KB |
| **Circuit Size** | 847.53 KB |
| **Witness Size** | 691.33 KB |
| **VK Size** | 3.59 KB |
| **Proof Size** | 15.88 KB |

### Config

## System Information

### Hardware
Expand Down
32 changes: 32 additions & 0 deletions circuits/benchmarks/results_secure/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@
| share_decryption | 1012104 | 3.54M | 12.98 MB | 19.20 MB | 3.59 KB | 15.88 KB |
| user_data_encryption | 1684299 | 4.02M | 20.75 MB | 23.82 MB | 3.59 KB | 15.88 KB |

### Config

#### Timing Metrics

| Circuit | Compile | Execute | Prove | Verify |
| ----------------------- | ------- | ------- | ------ | ------ |
| validate_secure_configs | 0.26 s | 0.26 s | 0.05 s | 0.02 s |

#### Size & Circuit Metrics

| Circuit | Opcodes | Gates | Circuit Size | Witness | VK Size | Proof Size |
| ----------------------- | ------- | ----- | ------------ | ------- | ------- | ---------- |
| validate_secure_configs | 0 | 54 | 568 B | 23 B | 3.59 KB | 15.88 KB |

## Circuit Details

### DKG
Expand Down Expand Up @@ -219,6 +233,24 @@
| **VK Size** | 3.59 KB |
| **Proof Size** | 15.88 KB |

### Config

#### validate_secure_configs

| Metric | Value |
| -------------------- | -------- |
| **Compilation** | 0.26 s |
| **Execution** | 0.26 s |
| **VK Generation** | 0.03 s |
| **Proof Generation** | 0.05 s |
| **Verification** | 0.02 s |
| **ACIR Opcodes** | "0" |
| **Total Gates** | "54" |
| **Circuit Size** | 568 B |
| **Witness Size** | 23 B |
| **VK Size** | 3.59 KB |
| **Proof Size** | 15.88 KB |

## System Information

### Hardware
Expand Down
13 changes: 13 additions & 0 deletions circuits/benchmarks/scripts/generate_prover_toml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ OUTPUT_DIR="${REPO_ROOT}/circuits/bin/${CIRCUIT_PATH}"

# Map circuit path to zk_cli --circuit and optional --inputs
# DKG circuits that need --inputs: share-computation, share-encryption, share-decryption
# config has no witness inputs (verifies constants only), so skip zk_cli
get_zk_args() {
local path="$1"
case "$path" in
config)
echo "_no_zk_cli"
return
;;
dkg/pk)
echo "pk"
return
Expand Down Expand Up @@ -88,6 +93,14 @@ ZK_INPUTS="${ZK_ARGS[1]:-}"

cd "$REPO_ROOT"

if [ "$ZK_CIRCUIT" = "_no_zk_cli" ]; then
echo " No Prover.toml needed (config circuit has no witness inputs)"
# Ensure empty Prover.toml so nargo execute can run
mkdir -p "$OUTPUT_DIR"
touch "$OUTPUT_DIR/Prover.toml"
exit 0
fi

CMD=(cargo run -p e3-zk-helpers --bin zk_cli -- --circuit "$ZK_CIRCUIT" --preset "$PRESET" --output "$OUTPUT_DIR" --toml --no-configs)
if [ -n "$ZK_INPUTS" ]; then
CMD+=(--inputs "$ZK_INPUTS")
Expand Down
Loading
Loading