|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <elliptic_relation.hpp>
Public Types | |
| using | FF = FF_ |
Static Public Member Functions | |
| template<typename AllEntities > | |
| static bool | skip (const AllEntities &in) |
| Returns true if the contribution from all subrelations for the provided inputs is identically zero. | |
| static constexpr FF | get_curve_b () |
| template<typename ContainerOverSubrelations , typename AllEntities , typename Parameters > | |
| static void | accumulate (ContainerOverSubrelations &accumulators, const AllEntities &in, const Parameters &, const FF &scaling_factor) |
| Expression for elliptic curve point addition and doubling. | |
Static Public Attributes | |
| static constexpr std::array< size_t, 2 > | SUBRELATION_PARTIAL_LENGTHS |
Definition at line 14 of file elliptic_relation.hpp.
| using bb::EllipticRelationImpl< FF_ >::FF = FF_ |
Definition at line 16 of file elliptic_relation.hpp.
|
inlinestatic |
Expression for elliptic curve point addition and doubling.
This relation implements elliptic curve addition/subtraction and doubling operations in short Weierstrass form: y^2 = x^3 + b. Given two distinct points P1 = (x1, y1) and P2 = (x2, y2), compute P3 = P1 ± P2 = (x3, y3) or given a point P1 = (x1, y1), compute P3 = 2*P1 = (x3, y3).
Addition/doubling subrelation constraints are toggled on and off via scaling by: q_elliptic * (1 - q_is_double) and q_elliptic * q_is_double respectively.
Subrelation 0 (x-coordinate): Formula: x3 = lambda^2 - x1 - x2, where lambda = (q_sign * y2 - y1) / (x2 - x1) Constraint (via cancellation of denominator and assumption that q_sign^2 = 1): (x3 + x1 + x2)(x2 - x1)^2 - (y2^2 - y1^2 + 2*q_sign*y2*y1) = 0
Subrelation 1 (y-coordinate): Formula: y3 = lambda * (x1 - x3) - y1 Constraint: (y3 + y1)(x2 - x1) + (q_sign*y2 - y1)(x3 - x1) = 0
Subrelation 0 (x-coordinate): Formula: x3 = lambda^2 - 2*x1, where lambda = (3*x1^2) / (2*y1) Constraint (via cancellation of denominator and using x1^3 = y1^2 - b): (x3 + 2*x1)*4*y1^2 - 9*x1*(y1^2 - b) = 0
Subrelation 1 (y-coordinate): Formula: y3 = lambda * (x1 - x3) - y1 Constraint: (y3 + y1)(x2 - x1) + (q_sign*y2 - y1)(x3 - x1) = 0
| accumulators | transformed to accumulators + C(in(X)...)*scaling_factor |
| in | an std::array containing the fully extended Univariate edges. |
| parameters | contains beta, gamma, and public_input_delta, .... |
| scaling_factor | optional term to scale the evaluation before adding to accumulators. |
Definition at line 80 of file elliptic_relation.hpp.
|
inlinestaticconstexpr |
Definition at line 30 of file elliptic_relation.hpp.
|
inlinestatic |
Returns true if the contribution from all subrelations for the provided inputs is identically zero.
Definition at line 27 of file elliptic_relation.hpp.
|
staticconstexpr |
Definition at line 18 of file elliptic_relation.hpp.