|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include "barretenberg/boomerang_value_detection/graph.hpp"#include "barretenberg/circuit_checker/circuit_checker.hpp"#include "barretenberg/common/test.hpp"#include "barretenberg/ecc/curves/secp256r1/secp256r1.hpp"#include "barretenberg/numeric/random/engine.hpp"#include "barretenberg/stdlib/primitives/bigfield/bigfield.hpp"#include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders.hpp"#include "barretenberg/stdlib/primitives/curves/secp256r1.hpp"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. | |
| using Builder = UltraCircuitBuilder |
Definition at line 23 of file graph_description_secp256r1.test.cpp.
| using element_ct = secp256r1_ct::Group |
Definition at line 25 of file graph_description_secp256r1.test.cpp.
| using scalar_ct = secp256r1_ct::ScalarField |
Definition at line 26 of file graph_description_secp256r1.test.cpp.
| using secp256r1_ct = stdlib::secp256r1<Builder> |
Definition at line 24 of file graph_description_secp256r1.test.cpp.
| using witness_ct = stdlib::witness_t<Builder> |
Definition at line 27 of file graph_description_secp256r1.test.cpp.
| 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 | ( | boomerang_secp256r1 | , |
| ecdsa_mul_edge_cases | |||
| ) |
Edge-case secp256r1_ecdsa_mul — verifies the count stays at 10 across all substitution branches.
u2_needs_subst=true, swaps u₂ for 2 via Fr::conditional_assign.secp256r1_fixed_base_mul(0) returns canonical infinity; T₁ + T₂ flows through operator+'s infinity handling.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 | ( | 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 | ( | 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 | ( | 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.