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 Point = typename Curve::AffineElement
 
using Fr = typename Curve::ScalarField
 
using Fq = typename Curve::BaseField
 
using VerifierCK = VerifierCommitmentKey< curve::BN254 >
 
using value_type = Point
 

Public Member Functions

PointP0 ()
 
PointP1 ()
 
const PointP0 () const
 
const PointP1 () const
 
 PairingPoints ()=default
 
 PairingPoints (const Point &p0, const Point &p1)
 
auto begin ()
 
auto end ()
 
auto begin () const
 
auto end () 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
 Verify the pairing equation e(P0, [1]₂) · e(P1, [x]₂) = 1.
 

Static Public Member Functions

static constexpr size_t size ()
 

Static Public Attributes

static constexpr size_t PUBLIC_INPUTS_SIZE = PAIRING_POINTS_SIZE
 
static constexpr size_t SIZE = 2
 

Private Attributes

std::array< Point, 2 > _points = { Point::infinity(), Point::infinity() }
 

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 22 of file pairing_points.hpp.

Member Typedef Documentation

◆ Curve

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

Definition at line 24 of file pairing_points.hpp.

◆ Fq

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

Definition at line 27 of file pairing_points.hpp.

◆ Fr

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

Definition at line 26 of file pairing_points.hpp.

◆ Point

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

Definition at line 25 of file pairing_points.hpp.

◆ value_type

template<typename Curve_ >
using bb::PairingPoints< Curve_ >::value_type = Point

Definition at line 33 of file pairing_points.hpp.

◆ VerifierCK

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

Definition at line 28 of file pairing_points.hpp.

Constructor & Destructor Documentation

◆ PairingPoints() [1/2]

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

◆ PairingPoints() [2/2]

template<typename Curve_ >
bb::PairingPoints< Curve_ >::PairingPoints ( const Point p0,
const Point p1 
)
inline

Definition at line 43 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.

If this is at infinity (default-constructed), simply copies other. The incoming points must not be at infinity since they should always represent the output of actual PCS verification.

Definition at line 59 of file pairing_points.hpp.

◆ begin() [1/2]

template<typename Curve_ >
auto bb::PairingPoints< Curve_ >::begin ( )
inline

Definition at line 48 of file pairing_points.hpp.

◆ begin() [2/2]

template<typename Curve_ >
auto bb::PairingPoints< Curve_ >::begin ( ) const
inline

Definition at line 50 of file pairing_points.hpp.

◆ check()

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

Verify the pairing equation e(P0, [1]₂) · e(P1, [x]₂) = 1.

Definition at line 77 of file pairing_points.hpp.

◆ end() [1/2]

template<typename Curve_ >
auto bb::PairingPoints< Curve_ >::end ( )
inline

Definition at line 49 of file pairing_points.hpp.

◆ end() [2/2]

template<typename Curve_ >
auto bb::PairingPoints< Curve_ >::end ( ) const
inline

Definition at line 51 of file pairing_points.hpp.

◆ P0() [1/2]

template<typename Curve_ >
Point & bb::PairingPoints< Curve_ >::P0 ( )
inline

Definition at line 37 of file pairing_points.hpp.

◆ P0() [2/2]

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

Definition at line 39 of file pairing_points.hpp.

◆ P1() [1/2]

template<typename Curve_ >
Point & bb::PairingPoints< Curve_ >::P1 ( )
inline

Definition at line 38 of file pairing_points.hpp.

◆ P1() [2/2]

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

Definition at line 40 of file pairing_points.hpp.

◆ size()

template<typename Curve_ >
static constexpr size_t bb::PairingPoints< Curve_ >::size ( )
inlinestaticconstexpr

Definition at line 52 of file pairing_points.hpp.

Member Data Documentation

◆ _points

template<typename Curve_ >
std::array<Point, 2> bb::PairingPoints< Curve_ >::_points = { Point::infinity(), Point::infinity() }
private

Definition at line 87 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 30 of file pairing_points.hpp.

◆ SIZE

template<typename Curve_ >
constexpr size_t bb::PairingPoints< Curve_ >::SIZE = 2
staticconstexpr

Definition at line 34 of file pairing_points.hpp.


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