Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::avm2::StandardAffinePoint< AffinePoint > Class Template Reference

#include <standard_affine_point.hpp>

Public Types

using BaseField = AffinePoint::Fq
 
using ScalarField = AffinePoint::Fr
 

Public Member Functions

constexpr StandardAffinePoint () noexcept=default
 
constexpr StandardAffinePoint (AffinePoint val) noexcept
 
constexpr StandardAffinePoint (BaseField x, BaseField y) noexcept
 
constexpr StandardAffinePoint operator+ (const StandardAffinePoint &other) const noexcept
 
constexpr StandardAffinePoint operator* (const ScalarField &exponent) const noexcept
 
constexpr bool operator== (const StandardAffinePoint &other) const noexcept
 
constexpr StandardAffinePoint operator- () const noexcept
 
constexpr bool is_infinity () const noexcept
 
constexpr bool on_curve () const noexcept
 
constexpr const BaseFieldx () const noexcept
 
constexpr const BaseFieldy () const noexcept
 

Static Public Member Functions

static const StandardAffinePointinfinity ()
 
static const StandardAffinePointone ()
 

Private Attributes

AffinePoint point
 
BaseField x_coord = zero
 
BaseField y_coord = zero
 

Static Private Attributes

static constexpr const auto zero = BaseField::zero()
 

Detailed Description

template<typename AffinePoint>
class bb::avm2::StandardAffinePoint< AffinePoint >

The AVM's representation of infinity is inherited from noir's and is expected to be 0,0. BB, however, uses only the two coordinates to represent points. Infinity in barretenberg is represented as (P+1)/2,0,true. This class is a wrapper of the BB representation, needed to operate with points, that allows us to extract the standard representation that AVM bytecode expects.

NOTE: When constructing infinity from BB's two element representation, we keep the original AffinePoint so operations can use it in the background, but set extractable coordinates to be our represention of (0,0). NOTE: When constructing infinity via BaseFields (equiv. inputting (0, 0), the underlying AffinePoint is set to BB's representation so operations can use it in the background.

Definition at line 19 of file standard_affine_point.hpp.

Member Typedef Documentation

◆ BaseField

template<typename AffinePoint >
using bb::avm2::StandardAffinePoint< AffinePoint >::BaseField = AffinePoint::Fq

Definition at line 21 of file standard_affine_point.hpp.

◆ ScalarField

template<typename AffinePoint >
using bb::avm2::StandardAffinePoint< AffinePoint >::ScalarField = AffinePoint::Fr

Definition at line 22 of file standard_affine_point.hpp.

Constructor & Destructor Documentation

◆ StandardAffinePoint() [1/3]

template<typename AffinePoint >
constexpr bb::avm2::StandardAffinePoint< AffinePoint >::StandardAffinePoint ( )
constexprdefaultnoexcept

◆ StandardAffinePoint() [2/3]

template<typename AffinePoint >
constexpr bb::avm2::StandardAffinePoint< AffinePoint >::StandardAffinePoint ( AffinePoint  val)
inlineconstexprnoexcept

Definition at line 26 of file standard_affine_point.hpp.

◆ StandardAffinePoint() [3/3]

template<typename AffinePoint >
constexpr bb::avm2::StandardAffinePoint< AffinePoint >::StandardAffinePoint ( BaseField  x,
BaseField  y 
)
inlineconstexprnoexcept

Definition at line 32 of file standard_affine_point.hpp.

Member Function Documentation

◆ infinity()

template<typename AffinePoint >
static const StandardAffinePoint & bb::avm2::StandardAffinePoint< AffinePoint >::infinity ( )
inlinestatic

Definition at line 82 of file standard_affine_point.hpp.

◆ is_infinity()

template<typename AffinePoint >
constexpr bool bb::avm2::StandardAffinePoint< AffinePoint >::is_infinity ( ) const
inlineconstexprnoexcept

Definition at line 72 of file standard_affine_point.hpp.

◆ on_curve()

template<typename AffinePoint >
constexpr bool bb::avm2::StandardAffinePoint< AffinePoint >::on_curve ( ) const
inlineconstexprnoexcept

Definition at line 74 of file standard_affine_point.hpp.

◆ one()

template<typename AffinePoint >
static const StandardAffinePoint & bb::avm2::StandardAffinePoint< AffinePoint >::one ( )
inlinestatic

Definition at line 88 of file standard_affine_point.hpp.

◆ operator*()

template<typename AffinePoint >
constexpr StandardAffinePoint bb::avm2::StandardAffinePoint< AffinePoint >::operator* ( const ScalarField exponent) const
inlineconstexprnoexcept

Definition at line 48 of file standard_affine_point.hpp.

◆ operator+()

template<typename AffinePoint >
constexpr StandardAffinePoint bb::avm2::StandardAffinePoint< AffinePoint >::operator+ ( const StandardAffinePoint< AffinePoint > &  other) const
inlineconstexprnoexcept

Definition at line 38 of file standard_affine_point.hpp.

◆ operator-()

template<typename AffinePoint >
constexpr StandardAffinePoint bb::avm2::StandardAffinePoint< AffinePoint >::operator- ( ) const
inlineconstexprnoexcept

Definition at line 63 of file standard_affine_point.hpp.

◆ operator==()

template<typename AffinePoint >
constexpr bool bb::avm2::StandardAffinePoint< AffinePoint >::operator== ( const StandardAffinePoint< AffinePoint > &  other) const
inlineconstexprnoexcept

Definition at line 58 of file standard_affine_point.hpp.

◆ x()

template<typename AffinePoint >
constexpr const BaseField & bb::avm2::StandardAffinePoint< AffinePoint >::x ( ) const
inlineconstexprnoexcept

Definition at line 78 of file standard_affine_point.hpp.

◆ y()

template<typename AffinePoint >
constexpr const BaseField & bb::avm2::StandardAffinePoint< AffinePoint >::y ( ) const
inlineconstexprnoexcept

Definition at line 80 of file standard_affine_point.hpp.

Member Data Documentation

◆ point

template<typename AffinePoint >
AffinePoint bb::avm2::StandardAffinePoint< AffinePoint >::point
private

Definition at line 97 of file standard_affine_point.hpp.

◆ x_coord

template<typename AffinePoint >
BaseField bb::avm2::StandardAffinePoint< AffinePoint >::x_coord = zero
private

Definition at line 100 of file standard_affine_point.hpp.

◆ y_coord

template<typename AffinePoint >
BaseField bb::avm2::StandardAffinePoint< AffinePoint >::y_coord = zero
private

Definition at line 101 of file standard_affine_point.hpp.

◆ zero

template<typename AffinePoint >
constexpr const auto bb::avm2::StandardAffinePoint< AffinePoint >::zero = BaseField::zero()
staticconstexprprivate

Definition at line 102 of file standard_affine_point.hpp.


The documentation for this class was generated from the following file: