|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
An object storing two EC points that represent the inputs to a pairing check. More...
#include <pairing_points.hpp>
Public Types | |
| using | Builder = typename Curve::Builder |
| using | Group = Curve::Group |
| using | Fq = Curve::BaseField |
| using | Fr = Curve::ScalarField |
Public Member Functions | |
| Group & | P0 () |
| Group & | P1 () |
| const Group & | P0 () const |
| const Group & | P1 () const |
| bool | is_populated () const |
| bool | is_default () const |
| PairingPoints ()=default | |
| PairingPoints (const Group &p0, const Group &p1) | |
| auto | begin () |
| auto | end () |
| auto | begin () const |
| auto | end () const |
| void | aggregate (PairingPoints const &other) |
| Aggregate another PairingPoints into this one via random linear combination. | |
| uint32_t | set_public (Builder *ctx=nullptr) |
| Set the witness indices for the pairing points to public. | |
| void | fix_witness () |
| Record the witness values of pairing points' coordinates in the selectors. | |
| bool | check () const |
| Perform native pairing check on the witness values. | |
Static Public Member Functions | |
| static PairingPoints | reconstruct_from_public (const std::span< const stdlib::field_t< Builder >, PUBLIC_INPUTS_SIZE > &limbs) |
| Reconstruct PairingPoints from public input limbs. | |
| static PairingPoints | aggregate_multiple (std::vector< PairingPoints > &pairing_points, bool handle_edge_cases=true) |
| Aggregate multiple PairingPoints using random linear combination. | |
| static uint32_t | set_default_to_public (Builder *builder) |
| Set the witness indices for the default (infinity) pairing points to public. | |
| static PairingPoints | construct_default () |
| Construct default pairing points (both at infinity). | |
Public Attributes | |
| uint32_t | tag_index = 0 |
Static Public Attributes | |
| static constexpr size_t | PUBLIC_INPUTS_SIZE = PAIRING_POINTS_SIZE |
Private Attributes | |
| std::array< Group, 2 > | _points |
| bool | has_data_ = false |
| bool | is_default_ = false |
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.
| Builder_ |
Definition at line 26 of file pairing_points.hpp.
| using bb::stdlib::recursion::PairingPoints< Curve >::Builder = typename Curve::Builder |
Definition at line 27 of file pairing_points.hpp.
| using bb::stdlib::recursion::PairingPoints< Curve >::Fq = Curve::BaseField |
Definition at line 29 of file pairing_points.hpp.
| using bb::stdlib::recursion::PairingPoints< Curve >::Fr = Curve::ScalarField |
Definition at line 30 of file pairing_points.hpp.
| using bb::stdlib::recursion::PairingPoints< Curve >::Group = Curve::Group |
Definition at line 28 of file pairing_points.hpp.
|
default |
|
inline |
Definition at line 47 of file pairing_points.hpp.
|
inline |
Aggregate another PairingPoints into this one via random linear combination.
Computes: this = this + r · other, where r is a 128-bit Fiat-Shamir challenge depending on both sets of points. If this is unpopulated (default-constructed), simply copies other.
| other | The PairingPoints to aggregate (must be populated). |
Definition at line 174 of file pairing_points.hpp.
|
inlinestatic |
Aggregate multiple PairingPoints using random linear combination.
Computes: P_agg = P₀ + r₁·P₁ + r₂·P₂ + ... + rₙ₋₁·Pₙ₋₁ where r₁,...,rₙ₋₁ are 128-bit challenges depending on all input points.
| pairing_points | Vector of pairing points to aggregate (requires size > 1) |
| handle_edge_cases | If true, batch_mul handles edge cases where points might be zero or challenges might cause numerical issues. If false, assumes all points are non-zero and non-colliding (saves circuit gates). |
Safety of handle_edge_cases=false:
Definition at line 96 of file pairing_points.hpp.
|
inline |
Definition at line 76 of file pairing_points.hpp.
|
inline |
Definition at line 78 of file pairing_points.hpp.
|
inline |
Perform native pairing check on the witness values.
Extracts native values from P0 and P1 and performs the pairing verification.
Definition at line 254 of file pairing_points.hpp.
|
inlinestatic |
Construct default pairing points (both at infinity).
The point at infinity trivially satisfies the pairing equation: e(∞, Q) = 1.
Definition at line 285 of file pairing_points.hpp.
|
inline |
Definition at line 77 of file pairing_points.hpp.
|
inline |
Definition at line 79 of file pairing_points.hpp.
|
inline |
Record the witness values of pairing points' coordinates in the selectors.
Definition at line 243 of file pairing_points.hpp.
|
inline |
Definition at line 43 of file pairing_points.hpp.
|
inline |
Definition at line 42 of file pairing_points.hpp.
|
inline |
Definition at line 37 of file pairing_points.hpp.
|
inline |
Definition at line 39 of file pairing_points.hpp.
|
inline |
Definition at line 38 of file pairing_points.hpp.
|
inline |
Definition at line 40 of file pairing_points.hpp.
|
inlinestatic |
Reconstruct PairingPoints from public input limbs.
Definition at line 65 of file pairing_points.hpp.
|
inlinestatic |
Set the witness indices for the default (infinity) pairing points to public.
Optimized version that directly sets zero Fr limb values as public inputs, avoiding expensive bigfield operations. The default pairing points are at infinity, which trivially satisfies the pairing equation
Definition at line 268 of file pairing_points.hpp.
|
inline |
Set the witness indices for the pairing points to public.
For default (infinity) pairing points, uses set_default_to_public which directly adds zero limbs as public inputs, bypassing bigfield::set_public() which cannot handle constant-coordinate infinity points.
| ctx | Optional builder context; required for default pairing points which have no circuit context. |
Definition at line 225 of file pairing_points.hpp.
|
private |
Definition at line 295 of file pairing_points.hpp.
|
private |
Definition at line 296 of file pairing_points.hpp.
|
private |
Definition at line 297 of file pairing_points.hpp.
|
staticconstexpr |
Definition at line 33 of file pairing_points.hpp.
| uint32_t bb::stdlib::recursion::PairingPoints< Curve >::tag_index = 0 |
Definition at line 35 of file pairing_points.hpp.