Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
grumpkin.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: not started, auditors: [], date: YYYY-MM-DD }
3// external_1: { status: not started, auditors: [], date: YYYY-MM-DD }
4// external_2: { status: not started, auditors: [], date: YYYY-MM-DD }
5// =====================
6
7#pragma once
8#include "../bigfield/bigfield.hpp"
9#include "../biggroup/biggroup.hpp"
10#include "../field/field.hpp"
13
14namespace bb::stdlib {
15
21template <typename CircuitBuilder> struct grumpkin {
22 static constexpr bool is_stdlib_type = true;
23 using Builder = CircuitBuilder;
25
26 // Stdlib types corresponding to those defined in the native description of the curve.
27 // Note: its useful to have these type names match the native analog exactly so that components that digest a
28 // Curve (e.g. the PCS) can be agnostic as to whether they're operating on native or stdlib types.
33 using Element = Group;
34
35 // Additional types with no analog in the native description of the curve
40
41 // Required by SmallSubgroupIPA argument
42 static constexpr size_t SUBGROUP_SIZE = 87;
43 // To find the generator below, we factored r - 1 into primes, where r is the modulus of the Grumkin scalar field,
44 // sampled a random field element, raised it to (r-1)/(3*29), and ensured that the resulting element is
45 // not generating a smaller subgroup. To avoid inversion in the recursive verifier, we also store its inverse.
46 static constexpr bb::fq subgroup_generator =
47 bb::fq("0x147c647c09fb639514909e9f0513f31ec1a523bf8a0880bc7c24fbc962a9586b");
49 bb::fq("0x0c68e27477b5e78cfab790bd3b59806fa871771f71ec7452cde5384f6e3a1988");
50 // The length of the polynomials used to mask the Sumcheck Round Univariates. In the ECCVM Sumcheck, the prover only
51 // sends 3 elements in every round - a commitment to the round univariate and its evaluations at 0 and 1. Therefore,
52 // length 3 is sufficient.
53 static constexpr uint32_t LIBRA_UNIVARIATES_LENGTH = 3;
54};
55
56} // namespace bb::stdlib
Implements boolean logic in-circuit.
Definition bool.hpp:59
Represents a dynamic array of bytes in-circuit.
cycle_group represents a group Element of the proving system's embedded curve i.e....
field< Bn254FqParams > fq
Definition fq.hpp:169
Curve grumpkin in circuit setting.
Definition grumpkin.hpp:21
static constexpr bool is_stdlib_type
Definition grumpkin.hpp:22
static constexpr bb::fq subgroup_generator
Definition grumpkin.hpp:46
CircuitBuilder Builder
Definition grumpkin.hpp:23
static constexpr bb::fq subgroup_generator_inverse
Definition grumpkin.hpp:48
static constexpr uint32_t LIBRA_UNIVARIATES_LENGTH
Definition grumpkin.hpp:53
static constexpr size_t SUBGROUP_SIZE
Definition grumpkin.hpp:42