|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
Custom element class for when using goblin. More...
#include <biggroup_goblin.hpp>
Public Types | |
| using | Builder = Builder_ |
| using | BaseField = Fq |
| using | bool_ct = stdlib::bool_t< Builder > |
| using | biggroup_tag = goblin_element |
Public Member Functions | |
| goblin_element ()=default | |
| goblin_element (const typename NativeGroup::affine_element &input) | |
| goblin_element (const Fq &x, const Fq &y, bool assert_on_curve=true) | |
| goblin_element (const goblin_element &other)=default | |
| goblin_element (goblin_element &&other) noexcept=default | |
| goblin_element & | operator= (const goblin_element &other)=default |
| goblin_element & | operator= (goblin_element &&other) noexcept=default |
| ~goblin_element ()=default | |
| void | incomplete_assert_equal (const goblin_element &other, const std::string msg="goblin_element::incomplete_assert_equal") const |
| Asserts that two goblin elements are equal (i.e., x, y coordinates are equal). | |
| void | convert_constant_to_fixed_witness (Builder *builder) |
| Creates fixed witnesses from a constant element. | |
| void | fix_witness () |
| void | validate_on_curve () const |
| goblin_element | checked_unconditional_add (const goblin_element &other) const |
| goblin_element | checked_unconditional_subtract (const goblin_element &other) const |
| goblin_element | operator+ (const goblin_element &other) const |
| goblin_element | operator- (const goblin_element &other) const |
| goblin_element | operator- () const |
| goblin_element | operator+= (const goblin_element &other) |
| goblin_element | operator-= (const goblin_element &other) |
| std::array< goblin_element, 2 > | checked_unconditional_add_sub (const goblin_element &other) const |
| goblin_element | operator* (const Fr &scalar) const |
| goblin_element | conditional_negate (const bool_ct &predicate) const |
| goblin_element | conditional_select (const goblin_element &other, const bool_ct &predicate) const |
Selects this if predicate is false, other if predicate is true. | |
| goblin_element | normalize () const |
| goblin_element | reduce () const |
| goblin_element | dbl () const |
| NativeGroup::affine_element | get_value () const |
| Builder * | get_context () const |
| Builder * | get_context (const goblin_element &other) const |
| goblin_element | get_standard_form () const |
| 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 element's tags. | |
| void | unset_free_witness_tag () |
| Unset the free witness flag for the goblin element's tags. | |
| uint32_t | set_public () const |
| Set the witness indices representing the goblin element to public. | |
| const Fq & | x () const |
| const Fq & | y () const |
| Fq & | x () |
| Fq & | y () |
Static Public Member Functions | |
| static goblin_element | from_witness (Builder *ctx, const typename NativeGroup::affine_element &input) |
| static goblin_element | one (Builder *ctx) |
| static goblin_element | constant_infinity (Builder *ctx) |
| Creates a constant point at infinity with canonical (0, 0) coordinates. | |
| static goblin_element | batch_mul (const std::vector< goblin_element > &points, const std::vector< Fr > &scalars, const size_t max_num_bits=0, const bool handle_edge_cases=false) |
| Goblin style batch multiplication. | |
Static Public Attributes | |
| static constexpr size_t | PUBLIC_INPUTS_SIZE = BIGGROUP_PUBLIC_INPUTS_SIZE |
Private Attributes | |
| Fq | _x |
| Fq | _y |
Custom element class for when using goblin.
When using goblin (builder = MEGA and element = bn254), the assumptions and heuristics we apply vary considerably to the "default" case, justifying a separate class (we use a using declaration to make element map to goblin_element if the correct parametrisation is used, see the IsGoblinBigGroup concept for details) Differences between goblin and regular biggroup elements:
| Builder | |
| Fq | |
| Fr | |
| NativeGroup |
Definition at line 31 of file biggroup_goblin.hpp.
| using bb::stdlib::element_goblin::goblin_element< Builder_, Fq, Fr, NativeGroup >::BaseField = Fq |
Definition at line 34 of file biggroup_goblin.hpp.
| using bb::stdlib::element_goblin::goblin_element< Builder_, Fq, Fr, NativeGroup >::biggroup_tag = goblin_element |
Definition at line 36 of file biggroup_goblin.hpp.
| using bb::stdlib::element_goblin::goblin_element< Builder_, Fq, Fr, NativeGroup >::bool_ct = stdlib::bool_t<Builder> |
Definition at line 35 of file biggroup_goblin.hpp.
| using bb::stdlib::element_goblin::goblin_element< Builder_, Fq, Fr, NativeGroup >::Builder = Builder_ |
Definition at line 33 of file biggroup_goblin.hpp.
|
default |
|
inline |
Definition at line 42 of file biggroup_goblin.hpp.
|
inline |
Definition at line 56 of file biggroup_goblin.hpp.
|
default |
|
defaultnoexcept |
|
default |
|
static |
Goblin style batch multiplication.
In goblin-style arithmetization, the operands (points/scalars) for each mul-accumulate operation are decomposed into smaller components and written to an operation queue via the builder. The components are also added as witness variables. This function adds constraints demonstrating the fidelity of the point/scalar decompositions given the indices of the components in the variables array. The actual mul-accumulate operations are performed natively (without constraints) under the hood, and the final result is obtained by queueing an equality operation via the builder. The components of the result are returned as indices into the variables array from which the resulting accumulator point is re-constructed.
| C | CircuitBuilder |
| Fq | Base field |
| Fr | Scalar field |
| G | Native group |
| points | |
| scalars | |
| max_num_bits |
Definition at line 39 of file biggroup_goblin_impl.hpp.
|
inline |
Definition at line 147 of file biggroup_goblin.hpp.
|
inline |
Definition at line 232 of file biggroup_goblin.hpp.
|
inline |
Definition at line 148 of file biggroup_goblin.hpp.
|
inline |
Definition at line 239 of file biggroup_goblin.hpp.
|
inline |
Selects this if predicate is false, other if predicate is true.
| other | |
| predicate |
Definition at line 254 of file biggroup_goblin.hpp.
|
inlinestatic |
Creates a constant point at infinity with canonical (0, 0) coordinates.
Definition at line 140 of file biggroup_goblin.hpp.
|
inline |
Creates fixed witnesses from a constant element.
Definition at line 102 of file biggroup_goblin.hpp.
|
inline |
Definition at line 274 of file biggroup_goblin.hpp.
|
inline |
Fix a witness. The value of the witness is constrained with a selector
Definition at line 112 of file biggroup_goblin.hpp.
|
inlinestatic |
Definition at line 83 of file biggroup_goblin.hpp.
|
inline |
Definition at line 301 of file biggroup_goblin.hpp.
|
inline |
Definition at line 312 of file biggroup_goblin.hpp.
|
inline |
Definition at line 332 of file biggroup_goblin.hpp.
|
inline |
Definition at line 330 of file biggroup_goblin.hpp.
|
inline |
Definition at line 289 of file biggroup_goblin.hpp.
|
inline |
Asserts that two goblin elements are equal (i.e., x, y coordinates are equal).
| other | |
| msg |
ECCVM ensures that point-at-infinity is canonically represented as (0, 0), so comparing coordinates is sufficient.
Definition at line 76 of file biggroup_goblin.hpp.
|
inline |
Definition at line 262 of file biggroup_goblin.hpp.
|
inlinestatic |
Definition at line 127 of file biggroup_goblin.hpp.
|
inline |
Definition at line 237 of file biggroup_goblin.hpp.
|
inline |
Definition at line 150 of file biggroup_goblin.hpp.
|
inline |
Definition at line 222 of file biggroup_goblin.hpp.
|
inline |
Definition at line 216 of file biggroup_goblin.hpp.
|
inline |
Definition at line 156 of file biggroup_goblin.hpp.
|
inline |
Definition at line 227 of file biggroup_goblin.hpp.
|
default |
|
defaultnoexcept |
|
inline |
Definition at line 268 of file biggroup_goblin.hpp.
|
inline |
Set the free witness flag for the goblin element's tags.
Definition at line 343 of file biggroup_goblin.hpp.
|
inline |
Definition at line 334 of file biggroup_goblin.hpp.
|
inline |
Set the witness indices representing the goblin element to public.
Each coordinate (x, y) is represented using 2 native field elements (lo, hi). Total: 4 field elements per goblin element.
Definition at line 364 of file biggroup_goblin.hpp.
|
inline |
Unset the free witness flag for the goblin element's tags.
Definition at line 352 of file biggroup_goblin.hpp.
|
inline |
Definition at line 122 of file biggroup_goblin.hpp.
|
inline |
Definition at line 376 of file biggroup_goblin.hpp.
|
inline |
Definition at line 373 of file biggroup_goblin.hpp.
|
inline |
Definition at line 377 of file biggroup_goblin.hpp.
|
inline |
Definition at line 374 of file biggroup_goblin.hpp.
|
private |
Definition at line 380 of file biggroup_goblin.hpp.
|
private |
Definition at line 381 of file biggroup_goblin.hpp.
|
staticconstexpr |
Definition at line 39 of file biggroup_goblin.hpp.