Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
ecc_shiftable_init_relation.hpp
Go to the documentation of this file.
1
// === AUDIT STATUS ===
2
// internal: { status: not started, auditors: [], commit: }
3
// external_1: { status: not started, auditors: [], commit: }
4
// external_2: { status: not started, auditors: [], commit: }
5
// =====================
6
7
#pragma once
8
#include "
barretenberg/relations/relation_types.hpp
"
9
10
namespace
bb
{
11
64
template
<
typename
FF_>
class
ECCVMShiftableInitRelationImpl
{
65
public
:
66
using
FF
= FF_;
67
68
enum
SubrelationIndex
:
size_t
{
69
// Load-bearing for soundness:
70
//
71
// Z_PERM_INIT and TRANSCRIPT_ACCUMULATOR_NOT_EMPTY_INIT were previously housed in
72
// ECCVMSetRelation and ECCVMTranscriptRelation respectively; centralizing them here
73
// keeps every direct `lagrange_first · col = 0` constraint in one place.
74
Z_PERM_INIT
= 0,
75
TRANSCRIPT_ACCUMULATOR_NOT_EMPTY_INIT
= 1,
76
PRECOMPUTE_SELECT_INIT
= 2,
77
TRANSCRIPT_MUL_INIT
= 3,
78
TRANSCRIPT_PC_INIT
= 4,
79
80
// Defense-in-depth (values not currently read at lagrange_first, but pinning makes
81
// the invariant explicit and robust to future relation changes):
82
PRECOMPUTE_SCALAR_SUM_INIT
= 5,
83
PRECOMPUTE_DX_INIT
= 6,
84
PRECOMPUTE_DY_INIT
= 7,
85
PRECOMPUTE_TX_INIT
= 8,
86
PRECOMPUTE_TY_INIT
= 9,
87
MSM_TRANSITION_INIT
= 10,
88
MSM_ADD_INIT
= 11,
89
MSM_DOUBLE_INIT
= 12,
90
MSM_SKEW_INIT
= 13,
91
MSM_ACCUMULATOR_X_INIT
= 14,
92
MSM_ACCUMULATOR_Y_INIT
= 15,
93
MSM_COUNT_INIT
= 16,
94
MSM_ROUND_INIT
= 17,
95
MSM_ADD1_INIT
= 18,
96
MSM_PC_INIT
= 19,
97
TRANSCRIPT_MSM_COUNT_INIT
= 20,
98
NUM_SUBRELATIONS
,
99
};
100
101
// Every subrelation is `lagrange_first · col · scaling_factor` (degree 2 in witnesses → partial length 3).
102
static
constexpr
std::array<size_t, 21>
SUBRELATION_PARTIAL_LENGTHS
{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
103
3, 3, 3, 3, 3, 3, 3, 3, 3, 3 };
104
static_assert
(
NUM_SUBRELATIONS
==
SUBRELATION_PARTIAL_LENGTHS
.size());
105
106
// skip after lagrange_first row
107
template
<
typename
AllEntities>
inline
static
bool
skip
(
const
AllEntities
& in)
108
{
109
return
in.
lagrange_first
.is_zero();
110
}
111
112
template
<
typename
ContainerOverSubrelations,
typename
AllEntities,
typename
Parameters>
113
static
void
accumulate
(ContainerOverSubrelations& accumulator,
114
const
AllEntities
& in,
115
const
Parameters&
/* unused */
,
116
const
FF
& scaling_factor);
117
};
118
119
template
<
typename
FF>
using
ECCVMShiftableInitRelation
=
Relation<ECCVMShiftableInitRelationImpl<FF>
>;
120
121
}
// namespace bb
bb::ECCVMShiftableInitRelationImpl
Pins every shiftable wire to 0 at the lagrange_first row (TRACE_OFFSET).
Definition
ecc_shiftable_init_relation.hpp:64
bb::ECCVMShiftableInitRelationImpl::SubrelationIndex
SubrelationIndex
Definition
ecc_shiftable_init_relation.hpp:68
bb::ECCVMShiftableInitRelationImpl::MSM_ACCUMULATOR_Y_INIT
@ MSM_ACCUMULATOR_Y_INIT
Definition
ecc_shiftable_init_relation.hpp:92
bb::ECCVMShiftableInitRelationImpl::MSM_ROUND_INIT
@ MSM_ROUND_INIT
Definition
ecc_shiftable_init_relation.hpp:94
bb::ECCVMShiftableInitRelationImpl::MSM_DOUBLE_INIT
@ MSM_DOUBLE_INIT
Definition
ecc_shiftable_init_relation.hpp:89
bb::ECCVMShiftableInitRelationImpl::PRECOMPUTE_DY_INIT
@ PRECOMPUTE_DY_INIT
Definition
ecc_shiftable_init_relation.hpp:84
bb::ECCVMShiftableInitRelationImpl::TRANSCRIPT_ACCUMULATOR_NOT_EMPTY_INIT
@ TRANSCRIPT_ACCUMULATOR_NOT_EMPTY_INIT
Definition
ecc_shiftable_init_relation.hpp:75
bb::ECCVMShiftableInitRelationImpl::PRECOMPUTE_DX_INIT
@ PRECOMPUTE_DX_INIT
Definition
ecc_shiftable_init_relation.hpp:83
bb::ECCVMShiftableInitRelationImpl::TRANSCRIPT_MSM_COUNT_INIT
@ TRANSCRIPT_MSM_COUNT_INIT
Definition
ecc_shiftable_init_relation.hpp:97
bb::ECCVMShiftableInitRelationImpl::PRECOMPUTE_SCALAR_SUM_INIT
@ PRECOMPUTE_SCALAR_SUM_INIT
Definition
ecc_shiftable_init_relation.hpp:82
bb::ECCVMShiftableInitRelationImpl::MSM_PC_INIT
@ MSM_PC_INIT
Definition
ecc_shiftable_init_relation.hpp:96
bb::ECCVMShiftableInitRelationImpl::PRECOMPUTE_TY_INIT
@ PRECOMPUTE_TY_INIT
Definition
ecc_shiftable_init_relation.hpp:86
bb::ECCVMShiftableInitRelationImpl::Z_PERM_INIT
@ Z_PERM_INIT
Definition
ecc_shiftable_init_relation.hpp:74
bb::ECCVMShiftableInitRelationImpl::PRECOMPUTE_TX_INIT
@ PRECOMPUTE_TX_INIT
Definition
ecc_shiftable_init_relation.hpp:85
bb::ECCVMShiftableInitRelationImpl::NUM_SUBRELATIONS
@ NUM_SUBRELATIONS
Definition
ecc_shiftable_init_relation.hpp:98
bb::ECCVMShiftableInitRelationImpl::PRECOMPUTE_SELECT_INIT
@ PRECOMPUTE_SELECT_INIT
Definition
ecc_shiftable_init_relation.hpp:76
bb::ECCVMShiftableInitRelationImpl::MSM_ADD1_INIT
@ MSM_ADD1_INIT
Definition
ecc_shiftable_init_relation.hpp:95
bb::ECCVMShiftableInitRelationImpl::TRANSCRIPT_PC_INIT
@ TRANSCRIPT_PC_INIT
Definition
ecc_shiftable_init_relation.hpp:78
bb::ECCVMShiftableInitRelationImpl::MSM_TRANSITION_INIT
@ MSM_TRANSITION_INIT
Definition
ecc_shiftable_init_relation.hpp:87
bb::ECCVMShiftableInitRelationImpl::TRANSCRIPT_MUL_INIT
@ TRANSCRIPT_MUL_INIT
Definition
ecc_shiftable_init_relation.hpp:77
bb::ECCVMShiftableInitRelationImpl::MSM_COUNT_INIT
@ MSM_COUNT_INIT
Definition
ecc_shiftable_init_relation.hpp:93
bb::ECCVMShiftableInitRelationImpl::MSM_ACCUMULATOR_X_INIT
@ MSM_ACCUMULATOR_X_INIT
Definition
ecc_shiftable_init_relation.hpp:91
bb::ECCVMShiftableInitRelationImpl::MSM_SKEW_INIT
@ MSM_SKEW_INIT
Definition
ecc_shiftable_init_relation.hpp:90
bb::ECCVMShiftableInitRelationImpl::MSM_ADD_INIT
@ MSM_ADD_INIT
Definition
ecc_shiftable_init_relation.hpp:88
bb::ECCVMShiftableInitRelationImpl::SUBRELATION_PARTIAL_LENGTHS
static constexpr std::array< size_t, 21 > SUBRELATION_PARTIAL_LENGTHS
Definition
ecc_shiftable_init_relation.hpp:102
bb::ECCVMShiftableInitRelationImpl::skip
static bool skip(const AllEntities &in)
Definition
ecc_shiftable_init_relation.hpp:107
bb::ECCVMShiftableInitRelationImpl::accumulate
static void accumulate(ContainerOverSubrelations &accumulator, const AllEntities &in, const Parameters &, const FF &scaling_factor)
Definition
ecc_shiftable_init_relation_impl.hpp:13
bb::ECCVMShiftableInitRelationImpl::FF
FF_ FF
Definition
ecc_shiftable_init_relation.hpp:66
bb::MegaFlavor_Generated::AllEntities
Definition
mega_flavor_generated.hpp:277
bb::MegaFlavor_Generated::AllEntities::lagrange_first
DataType & lagrange_first()
Definition
mega_flavor_generated.hpp:305
bb::Relation
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
Definition
relation_types.hpp:129
bb
Entry point for Barretenberg command-line interface.
Definition
api.hpp:5
relation_types.hpp
bb::field< bb::Bn254FrParams >
src
barretenberg
relations
ecc_vm
ecc_shiftable_init_relation.hpp
Generated by
1.9.8