Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::stdlib::recursion::PairingPoints< Builder_ > Struct Template Reference

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

#include <pairing_points.hpp>

Public Types

using Builder = Builder_
 
using Curve = bn254< Builder >
 
using Group = typename Curve::Group
 
using Fr = typename Curve::ScalarField
 

Public Member Functions

 PairingPoints ()=default
 
 PairingPoints (const Group &P0, const Group &P1)
 
 PairingPoints (std::array< Group, 2 > const &points)
 
Curve::bool_ct operator== (PairingPoints const &other) const
 
void aggregate (PairingPoints const &other)
 Compute a linear combination of the present pairing points with an input set of pairing points.
 
uint32_t set_public ()
 Set the witness indices for the limbs of the pairing points to public.
 

Static Public Member Functions

static PairingPoints< Builderreconstruct_from_public (const std::span< const Fr, PUBLIC_INPUTS_SIZE > &limbs)
 Reconstruct an PairingPoints from its representation as limbs (generally stored in the public inputs)
 
static std::array< fr, PUBLIC_INPUTS_SIZEconstruct_dummy ()
 
static void add_default_to_public_inputs (Builder &builder)
 Adds default public inputs to the builder.
 

Public Attributes

Group P0
 
Group P1
 
bool has_data = false
 

Static Public Attributes

static constexpr size_t PUBLIC_INPUTS_SIZE = PAIRING_POINTS_SIZE
 

Detailed Description

template<typename Builder_>
struct bb::stdlib::recursion::PairingPoints< Builder_ >

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

The points may represent the output of a single partial recursive verification or the linear combination of multiple sets of pairing points.

TODO(https://github.com/AztecProtocol/barretenberg/issues/1421): Proper tests for PairingPoints

Template Parameters
Builder_

Definition at line 24 of file pairing_points.hpp.

Member Typedef Documentation

◆ Builder

template<typename Builder_ >
using bb::stdlib::recursion::PairingPoints< Builder_ >::Builder = Builder_

Definition at line 25 of file pairing_points.hpp.

◆ Curve

template<typename Builder_ >
using bb::stdlib::recursion::PairingPoints< Builder_ >::Curve = bn254<Builder>

Definition at line 26 of file pairing_points.hpp.

◆ Fr

template<typename Builder_ >
using bb::stdlib::recursion::PairingPoints< Builder_ >::Fr = typename Curve::ScalarField

Definition at line 28 of file pairing_points.hpp.

◆ Group

template<typename Builder_ >
using bb::stdlib::recursion::PairingPoints< Builder_ >::Group = typename Curve::Group

Definition at line 27 of file pairing_points.hpp.

Constructor & Destructor Documentation

◆ PairingPoints() [1/3]

template<typename Builder_ >
bb::stdlib::recursion::PairingPoints< Builder_ >::PairingPoints ( )
default

◆ PairingPoints() [2/3]

template<typename Builder_ >
bb::stdlib::recursion::PairingPoints< Builder_ >::PairingPoints ( const Group P0,
const Group P1 
)
inline

Definition at line 39 of file pairing_points.hpp.

◆ PairingPoints() [3/3]

template<typename Builder_ >
bb::stdlib::recursion::PairingPoints< Builder_ >::PairingPoints ( std::array< Group, 2 > const &  points)
inline

Definition at line 45 of file pairing_points.hpp.

Member Function Documentation

◆ add_default_to_public_inputs()

template<typename Builder_ >
static void bb::stdlib::recursion::PairingPoints< Builder_ >::add_default_to_public_inputs ( Builder builder)
inlinestatic

Adds default public inputs to the builder.

This should cost exactly 20 gates because there's 4 bigfield elements and each have 5 total witnesses including the prime limb.

Parameters
builder

Definition at line 150 of file pairing_points.hpp.

◆ aggregate()

template<typename Builder_ >
void bb::stdlib::recursion::PairingPoints< Builder_ >::aggregate ( PairingPoints< Builder_ > const &  other)
inline

Compute a linear combination of the present pairing points with an input set of pairing points.

The linear combination is done with a recursion separator that is the hash of the two sets of pairing points.

Parameters
other
recursion_separator

Definition at line 60 of file pairing_points.hpp.

◆ construct_dummy()

template<typename Builder_ >
static std::array< fr, PUBLIC_INPUTS_SIZE > bb::stdlib::recursion::PairingPoints< Builder_ >::construct_dummy ( )
inlinestatic

Definition at line 124 of file pairing_points.hpp.

◆ operator==()

template<typename Builder_ >
Curve::bool_ct bb::stdlib::recursion::PairingPoints< Builder_ >::operator== ( PairingPoints< Builder_ > const &  other) const
inline

Definition at line 49 of file pairing_points.hpp.

◆ reconstruct_from_public()

template<typename Builder_ >
static PairingPoints< Builder > bb::stdlib::recursion::PairingPoints< Builder_ >::reconstruct_from_public ( const std::span< const Fr, PUBLIC_INPUTS_SIZE > &  limbs)
inlinestatic

Reconstruct an PairingPoints from its representation as limbs (generally stored in the public inputs)

Parameters
limbsThe limbs of the pairing points
Returns
PairingPoints<Builder>

Definition at line 114 of file pairing_points.hpp.

◆ set_public()

template<typename Builder_ >
uint32_t bb::stdlib::recursion::PairingPoints< Builder_ >::set_public ( )
inline

Set the witness indices for the limbs of the pairing points to public.

Returns
uint32_t The index into the public inputs array at which the representation is stored

Definition at line 99 of file pairing_points.hpp.

Member Data Documentation

◆ has_data

template<typename Builder_ >
bool bb::stdlib::recursion::PairingPoints< Builder_ >::has_data = false

Definition at line 32 of file pairing_points.hpp.

◆ P0

template<typename Builder_ >
Group bb::stdlib::recursion::PairingPoints< Builder_ >::P0

Definition at line 29 of file pairing_points.hpp.

◆ P1

template<typename Builder_ >
Group bb::stdlib::recursion::PairingPoints< Builder_ >::P1

Definition at line 30 of file pairing_points.hpp.

◆ PUBLIC_INPUTS_SIZE

template<typename Builder_ >
constexpr size_t bb::stdlib::recursion::PairingPoints< Builder_ >::PUBLIC_INPUTS_SIZE = PAIRING_POINTS_SIZE
staticconstexpr

Definition at line 35 of file pairing_points.hpp.


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