Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
ecc_wnaf_relation.hpp
Go to the documentation of this file.
1
// === AUDIT STATUS ===
2
// internal: { status: Complete, auditors: [Raju], commit: 2a49eb6 }
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
{
43
template
<
typename
FF_>
class
ECCVMWnafRelationImpl
{
44
public
:
45
using
FF
= FF_;
46
47
// Named subrelation indices — matches SUBRELATION_PARTIAL_LENGTHS ordering.
48
enum
SubrelationIndex
:
size_t
{
49
// Range checks: each 2-bit slice is in {0, 1, 2, 3}
50
RANGE_S1HI
= 0,
51
RANGE_S1LO
= 1,
52
RANGE_S2HI
= 2,
53
RANGE_S2LO
= 3,
54
RANGE_S3HI
= 4,
55
RANGE_S3LO
= 5,
56
RANGE_S4HI
= 6,
57
RANGE_S4LO
= 7,
58
// Scalar sum accumulation: check slice consistency across rows
59
SCALAR_SUM_CHECK
= 8,
60
// Round transition: combined round increment / round==7 check
61
ROUND_CHECK
= 9,
62
// Round shift must be 0 at transition or first row
63
ROUND_SHIFT_ZERO
= 10,
64
// Scalar sum shift must be 0 at transition or first row
65
SCALAR_SUM_SHIFT_ZERO
= 11,
66
// PC transition: combined pc decrement / pc propagation
67
PC_CHECK
= 12,
68
// Skew is 0 or 7
69
SKEW_RANGE
= 13,
70
// When precompute_select == 0: force slices to zero (w0)
71
INACTIVE_SLICE_W0
= 14,
72
// When precompute_select == 0: force slices to zero (w1)
73
INACTIVE_SLICE_W1
= 15,
74
// When precompute_select == 0: force slices to zero (w2)
75
INACTIVE_SLICE_W2
= 16,
76
// When precompute_select == 0: force slices to zero (w3)
77
INACTIVE_SLICE_W3
= 17,
78
// When precompute_select == 0: force round to zero
79
INACTIVE_ROUND
= 18,
80
// When precompute_select == 0: force pc to zero
81
INACTIVE_PC
= 19,
82
// First slice positive: s1hi_shift >= 2 at transitions
83
FIRST_SLICE_POSITIVE
= 20,
84
// When precompute_select == 0: force point_transition to zero
85
INACTIVE_POINT_TRANSITION
= 21,
86
// Precompute select shape: monotonically non-decreasing after first row
87
PRECOMPUTE_SELECT_SHAPE
= 22,
88
NUM_SUBRELATIONS
,
89
};
90
91
static
constexpr
std::array<size_t, 23>
SUBRELATION_PARTIAL_LENGTHS
{ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
92
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 };
93
static_assert
(
NUM_SUBRELATIONS
==
SUBRELATION_PARTIAL_LENGTHS
.size());
94
95
template
<
typename
ContainerOverSubrelations,
typename
AllEntities,
typename
Parameters>
96
static
void
accumulate
(ContainerOverSubrelations& accumulator,
97
const
AllEntities& in,
98
const
Parameters&
/* unused */
,
99
const
FF
& scaling_factor);
100
};
101
102
template
<
typename
FF>
using
ECCVMWnafRelation
=
Relation<ECCVMWnafRelationImpl<FF>
>;
103
104
}
// namespace bb
bb::ECCVMWnafRelationImpl
ECCVMWnafRelationImpl evaluates relations that convert scalar multipliers into 4-bit WNAF slices.
Definition
ecc_wnaf_relation.hpp:43
bb::ECCVMWnafRelationImpl::SUBRELATION_PARTIAL_LENGTHS
static constexpr std::array< size_t, 23 > SUBRELATION_PARTIAL_LENGTHS
Definition
ecc_wnaf_relation.hpp:91
bb::ECCVMWnafRelationImpl::SubrelationIndex
SubrelationIndex
Definition
ecc_wnaf_relation.hpp:48
bb::ECCVMWnafRelationImpl::RANGE_S4LO
@ RANGE_S4LO
Definition
ecc_wnaf_relation.hpp:57
bb::ECCVMWnafRelationImpl::SKEW_RANGE
@ SKEW_RANGE
Definition
ecc_wnaf_relation.hpp:69
bb::ECCVMWnafRelationImpl::RANGE_S4HI
@ RANGE_S4HI
Definition
ecc_wnaf_relation.hpp:56
bb::ECCVMWnafRelationImpl::INACTIVE_POINT_TRANSITION
@ INACTIVE_POINT_TRANSITION
Definition
ecc_wnaf_relation.hpp:85
bb::ECCVMWnafRelationImpl::INACTIVE_SLICE_W3
@ INACTIVE_SLICE_W3
Definition
ecc_wnaf_relation.hpp:77
bb::ECCVMWnafRelationImpl::INACTIVE_ROUND
@ INACTIVE_ROUND
Definition
ecc_wnaf_relation.hpp:79
bb::ECCVMWnafRelationImpl::RANGE_S2LO
@ RANGE_S2LO
Definition
ecc_wnaf_relation.hpp:53
bb::ECCVMWnafRelationImpl::RANGE_S1LO
@ RANGE_S1LO
Definition
ecc_wnaf_relation.hpp:51
bb::ECCVMWnafRelationImpl::PC_CHECK
@ PC_CHECK
Definition
ecc_wnaf_relation.hpp:67
bb::ECCVMWnafRelationImpl::INACTIVE_SLICE_W0
@ INACTIVE_SLICE_W0
Definition
ecc_wnaf_relation.hpp:71
bb::ECCVMWnafRelationImpl::ROUND_CHECK
@ ROUND_CHECK
Definition
ecc_wnaf_relation.hpp:61
bb::ECCVMWnafRelationImpl::FIRST_SLICE_POSITIVE
@ FIRST_SLICE_POSITIVE
Definition
ecc_wnaf_relation.hpp:83
bb::ECCVMWnafRelationImpl::INACTIVE_PC
@ INACTIVE_PC
Definition
ecc_wnaf_relation.hpp:81
bb::ECCVMWnafRelationImpl::RANGE_S3LO
@ RANGE_S3LO
Definition
ecc_wnaf_relation.hpp:55
bb::ECCVMWnafRelationImpl::RANGE_S3HI
@ RANGE_S3HI
Definition
ecc_wnaf_relation.hpp:54
bb::ECCVMWnafRelationImpl::NUM_SUBRELATIONS
@ NUM_SUBRELATIONS
Definition
ecc_wnaf_relation.hpp:88
bb::ECCVMWnafRelationImpl::RANGE_S2HI
@ RANGE_S2HI
Definition
ecc_wnaf_relation.hpp:52
bb::ECCVMWnafRelationImpl::SCALAR_SUM_CHECK
@ SCALAR_SUM_CHECK
Definition
ecc_wnaf_relation.hpp:59
bb::ECCVMWnafRelationImpl::SCALAR_SUM_SHIFT_ZERO
@ SCALAR_SUM_SHIFT_ZERO
Definition
ecc_wnaf_relation.hpp:65
bb::ECCVMWnafRelationImpl::PRECOMPUTE_SELECT_SHAPE
@ PRECOMPUTE_SELECT_SHAPE
Definition
ecc_wnaf_relation.hpp:87
bb::ECCVMWnafRelationImpl::INACTIVE_SLICE_W1
@ INACTIVE_SLICE_W1
Definition
ecc_wnaf_relation.hpp:73
bb::ECCVMWnafRelationImpl::RANGE_S1HI
@ RANGE_S1HI
Definition
ecc_wnaf_relation.hpp:50
bb::ECCVMWnafRelationImpl::ROUND_SHIFT_ZERO
@ ROUND_SHIFT_ZERO
Definition
ecc_wnaf_relation.hpp:63
bb::ECCVMWnafRelationImpl::INACTIVE_SLICE_W2
@ INACTIVE_SLICE_W2
Definition
ecc_wnaf_relation.hpp:75
bb::ECCVMWnafRelationImpl::accumulate
static void accumulate(ContainerOverSubrelations &accumulator, const AllEntities &in, const Parameters &, const FF &scaling_factor)
ECCVMWnafRelationImpl evaluates relations that convert scalar multipliers into 4-bit WNAF slices.
Definition
ecc_wnaf_relation_impl.hpp:46
bb::ECCVMWnafRelationImpl::FF
FF_ FF
Definition
ecc_wnaf_relation.hpp:45
bb::Relation
A wrapper for Relations to expose methods used by the Sumcheck prover or verifier to add the contribu...
Definition
relation_types.hpp:96
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_wnaf_relation.hpp
Generated by
1.9.8