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

An object storing two EC points that represent the inputs to a pairing check. More...

#include <pairing_points.hpp>

Public Types

using Curve = Curve_
 
using CK = CommitmentKey< Curve >
 
using Point = typename Curve::AffineElement
 
using Fr = typename Curve::ScalarField
 
using Fq = typename Curve::BaseField
 
using VerifierCK = VerifierCommitmentKey< curve::BN254 >
 

Public Member Functions

 PairingPoints ()=default
 
 PairingPoints (const Point &P0, const Point &P1)
 
 PairingPoints (std::array< Point, 2 > const &points)
 
Pointoperator[] (size_t idx)
 
const Pointoperator[] (size_t idx) const
 
void aggregate (const PairingPoints< Curve > &other)
 Aggregate the current pairing points with another set of pairing points using a random scalar.
 
bool check () const
 Perform the pairing check.
 
bool operator== (const PairingPoints< Curve > &other) const =default
 

Static Public Member Functions

static PairingPoints< Curvereconstruct_from_public (const std::span< const Fr, PUBLIC_INPUTS_SIZE > &limbs_in)
 Reconstruct the pairing points from limbs stored on the public inputs.
 

Public Attributes

Point P0 = Point::infinity()
 
Point P1 = Point::infinity()
 

Static Public Attributes

static constexpr size_t PUBLIC_INPUTS_SIZE = PAIRING_POINTS_SIZE
 

Detailed Description

template<typename Curve_>
class bb::PairingPoints< Curve_ >

An object storing two EC points that represent the inputs to a pairing check.

The points may represent the output of a single partial verification or the linear combination of multiple sets of pairing points, i.e. a pairing point "accumulator".

Note
This class is unified with the stdlib::recursion::PairingPoints class via the Curve template parameter.
Template Parameters
Curve_The curve type (defaults to curve::BN254 for native, or use stdlib::bn254<Builder> for recursive)

Definition at line 24 of file pairing_points.hpp.

Member Typedef Documentation

◆ CK

template<typename Curve_ >
using bb::PairingPoints< Curve_ >::CK = CommitmentKey<Curve>

Definition at line 27 of file pairing_points.hpp.

◆ Curve

template<typename Curve_ >
using bb::PairingPoints< Curve_ >::Curve = Curve_

Definition at line 26 of file pairing_points.hpp.

◆ Fq

template<typename Curve_ >
using bb::PairingPoints< Curve_ >::Fq = typename Curve::BaseField

Definition at line 30 of file pairing_points.hpp.

◆ Fr

template<typename Curve_ >
using bb::PairingPoints< Curve_ >::Fr = typename Curve::ScalarField

Definition at line 29 of file pairing_points.hpp.

◆ Point

template<typename Curve_ >
using bb::PairingPoints< Curve_ >::Point = typename Curve::AffineElement

Definition at line 28 of file pairing_points.hpp.

◆ VerifierCK

template<typename Curve_ >
using bb::PairingPoints< Curve_ >::VerifierCK = VerifierCommitmentKey<curve::BN254>

Definition at line 31 of file pairing_points.hpp.

Constructor & Destructor Documentation

◆ PairingPoints() [1/3]

template<typename Curve_ >
bb::PairingPoints< Curve_ >::PairingPoints ( )
default

◆ PairingPoints() [2/3]

template<typename Curve_ >
bb::PairingPoints< Curve_ >::PairingPoints ( const Point P0,
const Point P1 
)
inline

Definition at line 39 of file pairing_points.hpp.

◆ PairingPoints() [3/3]

template<typename Curve_ >
bb::PairingPoints< Curve_ >::PairingPoints ( std::array< Point, 2 > const &  points)
inline

Definition at line 44 of file pairing_points.hpp.

Member Function Documentation

◆ aggregate()

template<typename Curve_ >
void bb::PairingPoints< Curve_ >::aggregate ( const PairingPoints< Curve > &  other)
inline

Aggregate the current pairing points with another set of pairing points using a random scalar.

Definition at line 78 of file pairing_points.hpp.

◆ check()

template<typename Curve_ >
bool bb::PairingPoints< Curve_ >::check ( ) const
inline

Perform the pairing check.

Definition at line 93 of file pairing_points.hpp.

◆ operator==()

template<typename Curve_ >
bool bb::PairingPoints< Curve_ >::operator== ( const PairingPoints< Curve > &  other) const
default

◆ operator[]() [1/2]

template<typename Curve_ >
Point & bb::PairingPoints< Curve_ >::operator[] ( size_t  idx)
inline

Definition at line 48 of file pairing_points.hpp.

◆ operator[]() [2/2]

template<typename Curve_ >
const Point & bb::PairingPoints< Curve_ >::operator[] ( size_t  idx) const
inline

Definition at line 54 of file pairing_points.hpp.

◆ reconstruct_from_public()

template<typename Curve_ >
static PairingPoints< Curve > bb::PairingPoints< Curve_ >::reconstruct_from_public ( const std::span< const Fr, PUBLIC_INPUTS_SIZE > &  limbs_in)
inlinestatic

Reconstruct the pairing points from limbs stored on the public inputs.

Definition at line 64 of file pairing_points.hpp.

Member Data Documentation

◆ P0

template<typename Curve_ >
Point bb::PairingPoints< Curve_ >::P0 = Point::infinity()

Definition at line 35 of file pairing_points.hpp.

◆ P1

template<typename Curve_ >
Point bb::PairingPoints< Curve_ >::P1 = Point::infinity()

Definition at line 36 of file pairing_points.hpp.

◆ PUBLIC_INPUTS_SIZE

template<typename Curve_ >
constexpr size_t bb::PairingPoints< Curve_ >::PUBLIC_INPUTS_SIZE = PAIRING_POINTS_SIZE
staticconstexpr

Definition at line 33 of file pairing_points.hpp.


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