From f6525ed11afd252c0d4faec9346323db2d519a2a Mon Sep 17 00:00:00 2001 From: wborgeaud Date: Thu, 3 Mar 2022 04:15:15 +0100 Subject: [PATCH] Add wide config for ECDSA in < 2^16 gates --- plonky2/src/gadgets/ecdsa.rs | 10 +++++++++- plonky2/src/plonk/circuit_data.rs | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/plonky2/src/gadgets/ecdsa.rs b/plonky2/src/gadgets/ecdsa.rs index 5bf43b04..1f4012a6 100644 --- a/plonky2/src/gadgets/ecdsa.rs +++ b/plonky2/src/gadgets/ecdsa.rs @@ -74,7 +74,15 @@ mod tests { type Curve = Secp256K1; - let config = CircuitConfig::standard_ecc_config(); + const WIDE: bool = true; + + let config = if WIDE { + // < 2^16 gates. + CircuitConfig::wide_ecc_config() + } else { + // < 2^17 gates. + CircuitConfig::standard_ecc_config() + }; let pw = PartialWitness::new(); let mut builder = CircuitBuilder::::new(config); diff --git a/plonky2/src/plonk/circuit_data.rs b/plonky2/src/plonk/circuit_data.rs index 3d4ee2df..34b38fcf 100644 --- a/plonky2/src/plonk/circuit_data.rs +++ b/plonky2/src/plonk/circuit_data.rs @@ -86,6 +86,13 @@ impl CircuitConfig { } } + pub fn wide_ecc_config() -> Self { + Self { + num_wires: 234, + ..Self::standard_recursion_config() + } + } + pub fn standard_recursion_zk_config() -> Self { CircuitConfig { zero_knowledge: true,