|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
goblin_field wraps x/y coordinates of bn254 group elements when using goblin More...
#include <goblin_field.hpp>
Public Types | |
| using | field_ct = stdlib::field_t< Builder > |
| using | bool_ct = stdlib::bool_t< Builder > |
Public Member Functions | |
| goblin_field () | |
| goblin_field (Builder *parent_context, const uint256_t &value) | |
| goblin_field (bb::fq input) | |
| goblin_field (field_ct lo, field_ct hi) | |
| void | assert_equal (const goblin_field &other, const std::string &msg="goblin_field::assert_equal") const |
| void | convert_constant_to_fixed_witness (Builder *builder) |
| void | fix_witness () |
| uint512_t | get_value () const |
| uint512_t | get_maximum_value () const |
| Builder * | get_context () const |
| void | assert_is_in_field () |
| OriginTag | get_origin_tag () const |
| void | set_origin_tag (const OriginTag &tag) const |
| void | set_free_witness_tag () |
| Set the free witness flag for the goblin field's tags. | |
| void | unset_free_witness_tag () |
| Unset the free witness flag for the goblin field's tags. | |
| uint32_t | set_public () const |
| Set the witness indices for the limbs of the goblin field to public. | |
Static Public Member Functions | |
| static goblin_field | construct_from_limbs (field_ct lolo, field_ct lohi, field_ct hilo, field_ct hihi, bool can_overflow=false) |
| static goblin_field | zero () |
| static goblin_field | from_witness (Builder *ctx, bb::fq input) |
| static goblin_field | conditional_assign (const bool_ct &predicate, const goblin_field &lhs, goblin_field &rhs) |
Public Attributes | |
| std::array< field_ct, 2 > | limbs |
Static Public Attributes | |
| static const uint1024_t | DEFAULT_MAXIMUM_REMAINDER |
| static constexpr size_t | NUM_LIMBS = bigfield<Builder, bb::Bn254FqParams>::NUM_LIMBS |
| static constexpr size_t | NUM_LIMB_BITS = bigfield<Builder, bb::Bn254FqParams>::NUM_LIMB_BITS |
| static constexpr size_t | NUM_LAST_LIMB_BITS |
| static constexpr size_t | PUBLIC_INPUTS_SIZE = GOBLIN_FIELD_PUBLIC_INPUTS_SIZE |
goblin_field wraps x/y coordinates of bn254 group elements when using goblin
this class exists because we do not want to parametrise goblin bn254 coordinates with bigfield. bigfield generates a large number of constraints to apply checks that are not needed for goblin coordinates This is because, in the goblin context we can apply the following heuristics:
assert_is_in_fieldgoblin_field allows us to harvest these optimisations without a proliferation of edge cases and bloated logic in other classes | Builder |
Definition at line 29 of file goblin_field.hpp.
| using bb::stdlib::goblin_field< Builder >::bool_ct = stdlib::bool_t<Builder> |
Definition at line 39 of file goblin_field.hpp.
| using bb::stdlib::goblin_field< Builder >::field_ct = stdlib::field_t<Builder> |
Definition at line 38 of file goblin_field.hpp.
|
inline |
Definition at line 47 of file goblin_field.hpp.
|
inline |
Definition at line 50 of file goblin_field.hpp.
|
inline |
Definition at line 56 of file goblin_field.hpp.
|
inline |
Definition at line 63 of file goblin_field.hpp.
|
inline |
Definition at line 77 of file goblin_field.hpp.
|
inline |
Definition at line 150 of file goblin_field.hpp.
|
inlinestatic |
Definition at line 119 of file goblin_field.hpp.
|
inlinestatic |
Definition at line 69 of file goblin_field.hpp.
|
inline |
Create a witness from a constant. This way the value of the witness is fixed and public.
Definition at line 99 of file goblin_field.hpp.
|
inline |
Fix a witness. The value of the witness is constrained with a selector
Definition at line 110 of file goblin_field.hpp.
|
inlinestatic |
Definition at line 84 of file goblin_field.hpp.
|
inline |
Definition at line 141 of file goblin_field.hpp.
|
inline |
Definition at line 139 of file goblin_field.hpp.
|
inline |
Definition at line 152 of file goblin_field.hpp.
|
inline |
Definition at line 130 of file goblin_field.hpp.
|
inline |
Set the free witness flag for the goblin field's tags.
Definition at line 163 of file goblin_field.hpp.
|
inline |
Definition at line 154 of file goblin_field.hpp.
|
inline |
Set the witness indices for the limbs of the goblin field to public.
Goblin field is represented in public inputs using 2 limbs (lo, hi), matching the Codec representation.
Definition at line 185 of file goblin_field.hpp.
|
inline |
Unset the free witness flag for the goblin field's tags.
Definition at line 173 of file goblin_field.hpp.
|
inlinestatic |
Definition at line 82 of file goblin_field.hpp.
|
inlinestatic |
Definition at line 31 of file goblin_field.hpp.
| std::array<field_ct, 2> bb::stdlib::goblin_field< Builder >::limbs |
Definition at line 40 of file goblin_field.hpp.
|
staticconstexpr |
Definition at line 35 of file goblin_field.hpp.
|
staticconstexpr |
Definition at line 34 of file goblin_field.hpp.
|
staticconstexpr |
Definition at line 33 of file goblin_field.hpp.
|
staticconstexpr |
Definition at line 44 of file goblin_field.hpp.