dfns / cggmp21

State-of-art threshold ECDSA in Rust
Apache License 2.0
43 stars 6 forks source link

Change library API #45

Closed survived closed 1 year ago

survived commented 1 year ago
github-actions[bot] commented 1 year ago

Benchmark Result

Benchmarks ```text RUST_TESTS_SEED=88bc6ccd697e07bcc03073e5fbd567be171eb13737f85a86f39e35ca7988f821 n = 3 Key refresh protocol Protocol Performance: - Protocol took 3.54s to complete In particular: - Setup: 22.00µs - Retrieve auxiliary data: 1.30µs (5.9%) - Setup networking: 9.90µs (45.0%) - Precompute execution id and shared state: 10.50µs (47.7%) - Unstaged: 300.00ns (1.4%) - Round 1: 396.04ms - Retrieve primes (p and q): 300.00ns (0.0%) - Compute paillier decryption key (N): 21.53ms (5.4%) - Generate secret x_i and public X_i: 720.21µs (0.2%) - Generate auxiliary params r, λ, t, s: 5.62ms (1.4%) - Prove Πprm (ψˆ_i): 366.84ms (92.6%) - Compute schnorr commitment τ_j: 715.11µs (0.2%) - Sample random bytes: 900.00ns (0.0%) - Compute hash commitment and sample decommitment: 608.51µs (0.2%) - Unstaged: 500.00ns (0.0%) - Round 2: 5.10µs - Hash received msgs (reliability check): 4.70µs (92.2%) - Unstaged: 400.00ns (7.8%) - Round 3: 600.00ns - Assert other parties hashed messages (reliability check): 400.00ns (66.7%) - Unstaged: 200.00ns (33.3%) - Round 4: 2.18s - Validate round 1 decommitments: 1.03ms (0.0%) - Validate data sizes: 900.00ns (0.0%) - Validate П_prm (ψ_i): 733.35ms (33.7%) - Validate X_i: 49.90µs (0.0%) - Compute paillier encryption keys: 16.50µs (0.0%) - Add together shared random bytes: 5.30µs (0.0%) - Compute П_mod (ψ_i): 1.24s (56.9%) - Assemble security params for П_fac (ф_i): 2.10ms (0.1%) - Compute schnorr proof ψ_i^j: 17.30µs (0.0%) - Prepare auxiliary params and security level for proofs: 700.00ns (0.0%) - Paillier encryption of x_i^j: 48.07ms (2.2%) - Compute П_fac (ф_i^j): 154.22ms (7.1%) - Unstaged: 2.00µs (0.0%) - Round 5: 964.54ms - Paillier decrypt x_j^i from C_j^i: 41.94ms (4.3%) - Validate shares: 538.01µs (0.1%) - Validate schnorr proofs п_j and ψ_j^k: 2.93ms (0.3%) - Validate ψ_j (П_mod): 762.01ms (79.0%) - Validate ф_j (П_fac): 157.10ms (16.3%) - Calculate new x_i: 2.90µs (0.0%) - Calculate new X_i: 14.20µs (0.0%) - Assemble new core share: 500.00ns (0.0%) - Assemble auxiliary info: 4.90µs (0.0%) - Unstaged: 2.60µs (0.0%) Signing protocol Protocol Performance: - Protocol took 2.35s to complete In particular: - Setup: 26.90ms - Map t-out-of-n protocol to t-out-of-t: 11.50µs (0.0%) - Retrieve auxiliary data: 26.87ms (99.9%) - Precompute execution id and security params: 3.10µs (0.0%) - Setup networking: 7.80µs (0.0%) - Unstaged: 300.00ns (0.0%) - Round 1: 176.31ms - Generate local ephemeral secrets (k_i, y_i, p_i, v_i): 50.80µs (0.0%) - Encrypt G_i and K_i: 48.38ms (27.4%) - Prove ψ0_j: 127.88ms (72.5%) - Unstaged: 6.60µs (0.0%) - Round 2: 60.00µs - Hash received msgs (reliability check): 59.40µs (99.0%) - Unstaged: 600.00ns (1.0%) - Round 3: 1.15s - Assert other parties hashed messages (reliability check): 1.10µs (0.0%) - Verify psi0 proofs: 110.49ms (9.6%) - Sample random r, hat_r, s, hat_s, beta, hat_beta: 109.70µs (0.0%) - Encrypt D_ji: 90.28ms (7.8%) - Encrypt F_ji: 85.34ms (7.4%) - Encrypt hat_D_ji: 79.88ms (6.9%) - Encrypt hat_F_ji: 74.68ms (6.5%) - Prove psi_ji: 296.29ms (25.7%) - Prove psiˆ_ji: 282.21ms (24.5%) - Prove psi_prime_ji : 133.70ms (11.6%) - Unstaged: 4.70µs (0.0%) - Round 4: 873.99ms - Retrieve auxiliary data: 12.50µs (0.0%) - Validate psi: 278.71ms (31.9%) - Validate hat_psi: 264.27ms (30.2%) - Validate psi_prime: 115.94ms (13.3%) - Compute Gamma, Delta_i, delta_i, chi_i: 84.74ms (9.7%) - Prove psi_prime_prime: 130.31ms (14.9%) - Unstaged: 1.40µs (0.0%) - Presig output: 115.48ms - Validate psi_prime_prime: 114.93ms (99.5%) - Calculate presignature: 540.01µs (0.5%) - Unstaged: 2.70µs (0.0%) - Partial signing: 16.70µs - Signature reconstruction: 745.81µs ```