|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <scalar_multiplication_fast.hpp>
Public Types | |
| using | Element = typename Curve::Element |
| using | ScalarField = typename Curve::ScalarField |
| using | AffineElement = typename Curve::AffineElement |
Static Public Member Functions | |
| static AffineElement | msm (std::span< const AffineElement > points, PolynomialSpan< const ScalarField > scalars, bool handle_edge_cases=false, bool dedup_hint=false) noexcept |
| Single MSM_fast convenience wrapper — returns the result as an AffineElement. | |
| static std::vector< AffineElement > | batch_multi_scalar_mul (std::span< const AffineElement > points, std::span< PolynomialSpan< ScalarField > > scalars, bool handle_edge_cases=true, std::span< const uint8_t > dedup_hints={}) noexcept |
| Batch driver for multiple MSMs. Returns one AffineElement per input MSM_fast. | |
Definition at line 128 of file scalar_multiplication_fast.hpp.
| using bb::scalar_multiplication::MSM_fast< Curve >::AffineElement = typename Curve::AffineElement |
Definition at line 132 of file scalar_multiplication_fast.hpp.
| using bb::scalar_multiplication::MSM_fast< Curve >::Element = typename Curve::Element |
Definition at line 130 of file scalar_multiplication_fast.hpp.
| using bb::scalar_multiplication::MSM_fast< Curve >::ScalarField = typename Curve::ScalarField |
Definition at line 131 of file scalar_multiplication_fast.hpp.
|
staticnoexcept |
Batch driver for multiple MSMs. Returns one AffineElement per input MSM_fast.
Every MSM_fast in the batch shares a single contiguous point set (the SRS / GLV table); each MSM_fast picks its own range via scalars[m].start_index and scalars[m].size(). MSM_fast m computes Σ_i scalars[m][i] * points[scalars[m].start_index + i].
Independent MSMs run sequentially (each MSM_fast is itself round-parallel internally). This matches the legacy interface but the parallelisation strategy is different: the legacy implementation work-balanced points across threads spanning multiple MSMs; round-parallel parallelises within each MSM_fast, so one MSM_fast at a time uses the full thread pool. For the typical chonk workload (commit batches of polys of size 2^20), this is faster because per-MSM_fast threading dominates over inter-MSM_fast stealing.
| points | Shared point set (SRS prefix). Every MSM_fast indexes into this span. |
| scalars | Per-MSM_fast scalars carrying the start offset into points. |
| dedup_hints | Optional per-MSM_fast dedup opt-ins (parallel to scalars): a non-zero entry opts that MSM_fast's input scalars into the duplicate-cluster pre-pass. Empty span means no dedup anywhere. |
Definition at line 231 of file pippenger_batched.hpp.
|
staticnoexcept |
Single MSM_fast convenience wrapper — returns the result as an AffineElement.
| handle_edge_cases | false (default): fast affine round-parallel path. true: Jacobian fast path (handles edge cases). |
| dedup_hint | When true, opts this MSM_fast into the input-scalar dedup pre-pass. |
Definition at line 2908 of file scalar_multiplication_fast.cpp.