|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Non-Native Field Relation for emulating arithmetic over fields larger than the native circuit field. More...
#include <non_native_field_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. | |
| template<typename ContainerOverSubrelations , typename AllEntities , typename Parameters > | |
| static void | accumulate (ContainerOverSubrelations &accumulators, const AllEntities &in, BB_UNUSED const Parameters ¶ms, const FF &scaling_factor) |
| Accumulates constraints for non-native field multiplication and limb decomposition. | |
Static Public Attributes | |
| static constexpr std::array< size_t, 1 > | SUBRELATION_PARTIAL_LENGTHS |
Non-Native Field Relation for emulating arithmetic over fields larger than the native circuit field.
This relation enables arithmetic operations (multiplication, reduction) on "bigfield" elements, which represent values in a field larger than the circuit's native field (e.g., secp256k1's base field when proving over BN254). A bigfield element is decomposed into 68-bit limbs that fit within the native field, and this relation enforces correct limb-wise arithmetic with carry propagation.
The relation handles two types of constraints:
Definition at line 31 of file non_native_field_relation.hpp.
| using bb::NonNativeFieldRelationImpl< FF_ >::FF = FF_ |
Definition at line 33 of file non_native_field_relation.hpp.
|
inlinestatic |
Accumulates constraints for non-native field multiplication and limb decomposition.
Multiple selectors toggle different gate types within this single relation:
| gate type | q_nnf | q_2 | q_3 | q_4 | q_m |
|---|---|---|---|---|---|
| Bigfield Limb Accumulation 1 | 1 | 0 | 1 | 1 | 0 |
| Bigfield Limb Accumulation 2 | 1 | 0 | 1 | 0 | 1 |
| Bigfield Product 1 | 1 | 1 | 1 | 0 | 0 |
| Bigfield Product 2 | 1 | 1 | 0 | 1 | 0 |
| Bigfield Product 3 | 1 | 1 | 0 | 0 | 1 |
| evals | transformed to evals + C(in(X)...)*scaling_factor |
| in | an std::array containing the fully extended Univariate edges. |
| parameters | unused |
| scaling_factor | optional term to scale the evaluation before adding to evals. |
Definition at line 64 of file non_native_field_relation.hpp.
|
inlinestatic |
Returns true if the contribution from all subrelations for the provided inputs is identically zero.
Definition at line 43 of file non_native_field_relation.hpp.
|
staticconstexpr |
Definition at line 35 of file non_native_field_relation.hpp.