|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Namespaces | |
| namespace | detail |
Classes | |
| class | affine_element |
| struct | curve_for_element |
| struct | curve_for_element< fq, fr, Bn254G1Params > |
| struct | curve_for_element< fr, fq, grumpkin::G1Params > |
| class | element |
| element class. Implements ecc group arithmetic using Jacobian coordinates See https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l More... | |
| class | TestElementPrivate |
Concepts | |
| concept | SupportsHashToCurve |
Functions | |
| template<typename B , typename Fq_ , typename Fr_ , typename Params > | |
| void | read (B &it, group_elements::affine_element< Fq_, Fr_, Params > &element) |
| template<typename B , typename Fq_ , typename Fr_ , typename Params > | |
| void | write (B &it, group_elements::affine_element< Fq_, Fr_, Params > const &element) |
| template<class Fq , class Fr , class Params > | |
| std::ostream & | operator<< (std::ostream &os, element< Fq, Fr, Params > const &e) |
| template<typename AffineElement , typename Fq > | |
| __attribute__ ((always_inline)) inline void batch_affine_add_impl(const AffineElement *lhs | |
| Batch affine addition for parallel arrays: (lhs[i], rhs[i]) → rhs[i]. | |
| for (size_t i=0;i< num_pairs;++i) | |
| if (batch_inversion_accumulator==Fq::zero()) | |
| for (size_t i_plus_1=num_points;i_plus_1 > 0;--i_plus_1) | |
Variables | |
| AffineElement * | rhs |
| AffineElement const size_t | num_pairs |
| AffineElement const size_t Fq *scratch_space | noexcept |
| batch_inversion_accumulator = batch_inversion_accumulator.invert() | |
| const size_t | num_points |
| Fq | temp_x |
| bb::group_elements::__attribute__ | ( | (always_inline) | ) | const |
Batch affine addition for parallel arrays: (lhs[i], rhs[i]) → rhs[i].
Batch affine point doubling using Montgomery's trick.
Batch affine addition for interleaved arrays: pairs (points[2i], points[2i+1]) → points[num_points/2 + i].
Uses Montgomery's batch inversion trick. lhs and rhs are separate arrays so no aliasing issues.
| lhs | Input array of first summands (read-only) |
| rhs | Input array of second summands; results are written here (rhs[i] = lhs[i] + rhs[i]) |
| num_pairs | Number of point pairs to add |
| scratch_space | Temporary storage for batch inversion, size >= num_pairs |
Optimized for the pippenger interleaved memory layout where lhs and rhs live in the same contiguous array. Uses direct address arithmetic and hardcoded prefetch to avoid aliasing penalties that arise when the generic batch_affine_add_impl is called with lhs_base == rhs_base (the compiler cannot prove that writes to output don't alias reads from lhs, forcing unnecessary reloads).
| points | Interleaved array: [lhs0, rhs0, lhs1, rhs1, ...]. Results written to top half. |
| num_points | Total number of points (must be even). Number of pairs = num_points / 2. |
| scratch_space | Temporary storage for batch inversion, size >= num_points / 2. |
| AffineElement | Affine point type |
| Fq | Base field type |
| bb::group_elements::for | ( | ) |
Definition at line 644 of file element_impl.hpp.
| bb::group_elements::for | ( | size_t | i_plus_1 = num_points; i_plus_1, |
| 0;-- | i_plus_1 | ||
| ) |
Definition at line 762 of file element_impl.hpp.
| bb::group_elements::if | ( | batch_inversion_accumulator | = = Fq::zero() | ) |
Definition at line 652 of file element_impl.hpp.
| std::ostream & bb::group_elements::operator<< | ( | std::ostream & | os, |
| element< Fq, Fr, Params > const & | e | ||
| ) |
Definition at line 138 of file element.hpp.
|
inline |
Definition at line 304 of file affine_element.hpp.
|
inline |
Definition at line 314 of file affine_element.hpp.
| bb::group_elements::batch_inversion_accumulator = batch_inversion_accumulator.invert() |
Definition at line 655 of file element_impl.hpp.
| const size_t Fq *scratch_space bb::group_elements::noexcept |
Definition at line 639 of file element_impl.hpp.
| AffineElement const size_t bb::group_elements::num_pairs |
Definition at line 638 of file element_impl.hpp.
| const size_t bb::group_elements::num_points |
Definition at line 685 of file element_impl.hpp.
| AffineElement* bb::group_elements::rhs |
Definition at line 637 of file element_impl.hpp.
| Fq bb::group_elements::temp_x |
Definition at line 761 of file element_impl.hpp.