34 static constexpr size_t SIZE = 2;
52 static constexpr size_t size() {
return SIZE; }
64 const bool this_p0_inf = (
P0() == Point::infinity());
65 const bool this_p1_inf = (
P1() == Point::infinity());
66 const bool other_p0_inf = (other.
P0() == Point::infinity());
67 const bool other_p1_inf = (other.
P1() == Point::infinity());
69 const bool this_is_default = this_p0_inf && this_p1_inf;
70 const bool this_is_mixed = this_p0_inf != this_p1_inf;
71 const bool other_is_default = other_p0_inf && other_p1_inf;
72 const bool other_is_mixed = other_p0_inf != other_p1_inf;
74 if (other_is_default || other_is_mixed) {
75 throw_or_abort(
"Cannot aggregate: incoming pairing points are at infinity or mixed-infinity.");
78 throw_or_abort(
"Cannot aggregate: accumulator pairing points are mixed-infinity (corrupted state).");
81 if (this_is_default) {
86 P0() =
P0() + other.
P0() * aggregation_separator;
87 P1() =
P1() + other.
P1() * aggregation_separator;
103 std::array<Point, 2>
_points = { Point::infinity(), Point::infinity() };
110template <
typename Curve>
struct tuple_size<
bb::PairingPoints<Curve>> : std::integral_constant<size_t, 2> {};
#define BB_BENCH_NAME(name)
An object storing two EC points that represent the inputs to a pairing check.
void aggregate(const PairingPoints< Curve > &other)
Aggregate the current pairing points with another set of pairing points using a random scalar.
static constexpr size_t size()
std::array< Point, 2 > _points
static constexpr size_t PUBLIC_INPUTS_SIZE
static constexpr size_t SIZE
PairingPoints(const Point &p0, const Point &p1)
bool check() const
Verify the pairing equation e(P0, [1]₂) · e(P1, [x]₂) = 1.
typename Curve::BaseField Fq
typename Curve::AffineElement Point
typename Curve::ScalarField Fr
Specialization for bn254.
bool pairing_check(const GroupElement &p0, const GroupElement &p1)
Verify the pairing equation e(P₀,[1]₂) · e(P₁,[x]₂) = [1]ₜ
Representation of the Grumpkin Verifier Commitment Key inside a bn254 circuit.
typename Group::affine_element AffineElement
Entry point for Barretenberg command-line interface.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
static field random_element(numeric::RNG *engine=nullptr) noexcept
void throw_or_abort(std::string const &err)