Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::group_elements Namespace Reference

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...
 
struct  InterleavedArrayPolicy
 Memory layout policy for batch affine operations with interleaved arrays. More...
 
struct  ParallelArrayPolicy
 Memory layout policy for batch affine operations with parallel arrays. 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 Policy , typename AffineElement , typename Fq >
 __attribute__ ((always_inline)) inline void batch_affine_add_impl(const AffineElement *lhs_base
 Core batch affine addition using Montgomery's batch inversion trick.
 
 for (size_t i=0;i< num_pairs;++i)
 
 if (batch_inversion_accumulator==Fq::zero())
 
 for (size_t i_plus_1=num_pairs;i_plus_1 > 0;--i_plus_1)
 
template<typename AffineElement , typename Fq >
 __attribute__ ((always_inline)) inline void batch_affine_double_impl(AffineElement *points
 Batch affine point doubling using Montgomery's trick.
 

Variables

AffineElement * rhs_base
 
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
 

Function Documentation

◆ __attribute__() [1/2]

template<typename Policy , typename AffineElement , typename Fq >
bb::group_elements::__attribute__ ( (always_inline)  ) const

Core batch affine addition using Montgomery's batch inversion trick.

Template Parameters
PolicyMemory layout policy (ParallelArrayPolicy or InterleavedArrayPolicy)
AffineElementAffine point type
FqBase field type
Warning
ASSUMES NO EDGE CASES:
  • All points must be valid (not point at infinity)
  • lhs[i] != rhs[i] for all i (no point doubling cases)
  • lhs[i] != -rhs[i] for all i (no point at infinity results)
  • Points are linearly independent (generic position)
Note
This is the "unsafe" fast path. For general point addition with edge case handling, use Jacobian arithmetic or handle edge cases separately before calling this function.

◆ __attribute__() [2/2]

template<typename AffineElement , typename Fq >
bb::group_elements::__attribute__ ( (always_inline)  )

Batch affine point doubling using Montgomery's trick.

Template Parameters
AffineElementAffine point type
FqBase field type
Warning
ASSUMES NO EDGE CASES:
  • All points must be valid (not point at infinity)
  • points[i].y != 0 for all i (no vertical tangents)
  • No points with order 2 (where 2P = point at infinity)
Note
This is the "unsafe" fast path. For general point doubling with edge case handling, use Jacobian arithmetic or check for edge cases before calling this function.

◆ for() [1/2]

bb::group_elements::for ( )

Definition at line 738 of file element_impl.hpp.

◆ for() [2/2]

bb::group_elements::for ( size_t  i_plus_1 = num_pairs; i_plus_1,
0;--  i_plus_1 
)

Definition at line 756 of file element_impl.hpp.

◆ if()

bb::group_elements::if ( batch_inversion_accumulator  = Fq::zero())

Definition at line 750 of file element_impl.hpp.

◆ operator<<()

template<class Fq , class Fr , class Params >
std::ostream & bb::group_elements::operator<< ( std::ostream &  os,
element< Fq, Fr, Params > const &  e 
)

Definition at line 164 of file element.hpp.

◆ read()

template<typename B , typename Fq_ , typename Fr_ , typename Params >
void bb::group_elements::read ( B &  it,
group_elements::affine_element< Fq_, Fr_, Params > &  element 
)
inline

Definition at line 303 of file affine_element.hpp.

◆ write()

template<typename B , typename Fq_ , typename Fr_ , typename Params >
void bb::group_elements::write ( B &  it,
group_elements::affine_element< Fq_, Fr_, Params > const &  element 
)
inline

Definition at line 313 of file affine_element.hpp.

Variable Documentation

◆ batch_inversion_accumulator

bb::group_elements::batch_inversion_accumulator = batch_inversion_accumulator.invert()

Definition at line 753 of file element_impl.hpp.

◆ noexcept

const size_t Fq *scratch_space bb::group_elements::noexcept

◆ num_pairs

AffineElement const size_t bb::group_elements::num_pairs

Definition at line 732 of file element_impl.hpp.

◆ num_points

const size_t bb::group_elements::num_points

Definition at line 793 of file element_impl.hpp.

◆ rhs_base

AffineElement* bb::group_elements::rhs_base

Definition at line 731 of file element_impl.hpp.

◆ temp_x

Fq bb::group_elements::temp_x

Definition at line 812 of file element_impl.hpp.