Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
graph_description_secp256r1.test.cpp File Reference

Go to the source code of this file.

Typedefs

using Builder = UltraCircuitBuilder
 
using secp256r1_ct = stdlib::secp256r1< Builder >
 
using element_ct = secp256r1_ct::Group
 
using scalar_ct = secp256r1_ct::ScalarField
 
using witness_ct = stdlib::witness_t< Builder >
 

Functions

 TEST (boomerang_secp256r1, fixed_base_mul)
 Static analysis of secp256r1_fixed_base_mul on a random witness scalar.
 
 TEST (boomerang_secp256r1, ecdsa_mul)
 Static analysis of secp256r1_ecdsa_mul on random witness inputs.
 
 TEST (boomerang_secp256r1, fixed_base_mul_u_zero)
 secp256r1_fixed_base_mul(u=0) — exercises the offset-subtract-to-infinity edge case.
 
 TEST (boomerang_secp256r1, two_ecdsa_muls_in_same_builder)
 Two secp256r1_ecdsa_mul calls in the same builder.
 
 TEST (boomerang_secp256r1, ecdsa_mul_edge_cases)
 Edge-case secp256r1_ecdsa_mul — verifies the count stays at 10 across all substitution branches.
 

Typedef Documentation

◆ Builder

◆ element_ct

◆ scalar_ct

◆ secp256r1_ct

◆ witness_ct

Function Documentation

◆ TEST() [1/5]

TEST ( boomerang_secp256r1  ,
ecdsa_mul   
)

Static analysis of secp256r1_ecdsa_mul on random witness inputs.

Definition at line 110 of file graph_description_secp256r1.test.cpp.

◆ TEST() [2/5]

TEST ( boomerang_secp256r1  ,
ecdsa_mul_edge_cases   
)

Edge-case secp256r1_ecdsa_mul — verifies the count stays at 10 across all substitution branches.

  • u₂ ∈ {0, ±1}: triggers u2_needs_subst=true, swaps u₂ for 2 via Fr::conditional_assign.
  • u₁ = 0: secp256r1_fixed_base_mul(0) returns canonical infinity; T₁ + T₂ flows through operator+'s infinity handling.
  • Both zero: both paths exercised together.

Input-independence of the count means the circuit's wire structure does not depend on the runtime input value — no wire that exists for one input becomes "unused" for another.

Definition at line 185 of file graph_description_secp256r1.test.cpp.

◆ TEST() [3/5]

TEST ( boomerang_secp256r1  ,
fixed_base_mul   
)

Static analysis of secp256r1_fixed_base_mul on a random witness scalar.

Inputs and outputs are fixed so the count reflects only the internal wiring (plookup reads + chain-adds + offset subtract).

Definition at line 90 of file graph_description_secp256r1.test.cpp.

◆ TEST() [4/5]

TEST ( boomerang_secp256r1  ,
fixed_base_mul_u_zero   
)

secp256r1_fixed_base_mul(u=0) — exercises the offset-subtract-to-infinity edge case.

With u=0, raw_result == total_offset, so the final operator- collapses to canonical infinity. Verifies the infinity-detection path doesn't introduce unconstrained witnesses.

Definition at line 126 of file graph_description_secp256r1.test.cpp.

◆ TEST() [5/5]

TEST ( boomerang_secp256r1  ,
two_ecdsa_muls_in_same_builder   
)

Two secp256r1_ecdsa_mul calls in the same builder.

Asserts the count scales linearly (2 × EXPECTED_ECDSA_MUL_ONE_GATE_VARS). Non-linear scaling would indicate shared state between invocations — e.g., a stale lookup-table index, accumulator carryover, or the per-instance MultiTable setup leaking witnesses across calls.

Definition at line 148 of file graph_description_secp256r1.test.cpp.