Skip to content

Commit 2f77ec5

Browse files
feat: merge-train/barretenberg (#22363)
BEGIN_COMMIT_OVERRIDE fix: addresses logic audit findings (#22304) chore: fix asm_self_* field arithmetic signatures (#22353) fix: polynomials module audit response (#22361) chore: UB updates (#22308) fix: increase test timeout for heavy recursion tests in debug build (#22347) chore: origin tag updates (#22307) chore: ECCVM QoL — operator precedence fix, assert correctness, documentation (#22351) fix: minor bigfield fixes - take 2 (#22415) chore: decouple perm arg boundary from shiftability assumptions (#22396) END_COMMIT_OVERRIDE
2 parents d7934b9 + e089081 commit 2f77ec5

File tree

58 files changed

+1287
-523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1287
-523
lines changed

barretenberg/cpp/bootstrap.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,13 @@ function test_cmds_native {
248248
local prefix=$hash
249249
# A little extra resource for these tests.
250250
# IPARecursiveTests fails with 2 threads.
251-
if [[ "$test" =~ ^(AcirAvmRecursionConstraint|ChonkKernelCapacity|AvmRecursiveTests|IPARecursiveTests|HonkRecursionConstraintTest) ]]; then
251+
if [[ "$test" =~ ^(AcirAvmRecursionConstraint|ChonkKernelCapacity|AvmRecursiveTests|IPARecursiveTests|HonkRecursionConstraintTest|ChonkRecursionConstraintTest) ]]; then
252252
prefix="$prefix:CPUS=4:MEM=8g"
253253
fi
254+
# These tests routinely take 400-600s in debug builds; bump from the 600s default.
255+
if [[ "$test" =~ ^(HonkRecursionConstraintTest|ChonkRecursionConstraintTest) ]]; then
256+
prefix="$prefix:TIMEOUT=900s"
257+
fi
254258
echo -e "$prefix barretenberg/cpp/scripts/run_test.sh $bin_name $test"
255259
done || (echo "Failed to list tests in $bin" && exit 1)
256260
done

barretenberg/cpp/scripts/test_chonk_standalone_vks_havent_changed.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ script_path="$root/barretenberg/cpp/scripts/test_chonk_standalone_vks_havent_cha
2121
# - Generate a hash for versioning: sha256sum bb-chonk-inputs.tar.gz
2222
# - Upload the compressed results: aws s3 cp bb-chonk-inputs.tar.gz s3://aztec-ci-artifacts/protocol/bb-chonk-inputs-[hash(0:8)].tar.gz
2323
# Note: In case of the "Test suite failed to run ... Unexpected token 'with' " error, need to run: docker pull aztecprotocol/build:3.0
24-
pinned_short_hash="33a01e19"
24+
pinned_short_hash="50947760"
2525
pinned_chonk_inputs_url="https://aztec-ci-artifacts.s3.us-east-2.amazonaws.com/protocol/bb-chonk-inputs-${pinned_short_hash}.tar.gz"
2626

2727
function update_pinned_hash_in_script {

barretenberg/cpp/src/barretenberg/commitment_schemes/kzg/kzg.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ template <typename Curve_> class KZG {
9191
quotient_commitment,
9292
GroupElement::one(builder) };
9393
std::vector<Fr> scalars = { one, claim.opening_pair.challenge, -claim.opening_pair.evaluation };
94-
P_0 = GroupElement::batch_mul(commitments, scalars);
94+
95+
// Compute C + r*[W]_1 + (-v)*[1]_1 as a batch_mul, no need of edge case handling since we don't expect the
96+
// points to be linearly dependent.
97+
P_0 = GroupElement::batch_mul(commitments, scalars, /*max_num_bits=*/0, /*with_edgecases=*/false);
9598

9699
} else {
97100
P_0 = claim.commitment;

barretenberg/cpp/src/barretenberg/commitment_schemes/shplonk/shplemini.hpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -517,19 +517,12 @@ template <typename Curve, bool HasZK = false> class ShpleminiVerifier_ {
517517
}
518518

519519
// Erase the duplicate entries (higher-index range first to preserve lower indices)
520-
auto erase_range = [&](size_t duplicate_start, size_t original_start, size_t count) {
520+
// Each erase shifts elements down, so duplicate_start always points to the next duplicate;
521+
// the original at original_start + i is unaffected since we erase higher-index ranges first.
522+
// Commitment equality (original == duplicate) is verified by per-flavor
523+
// RepeatedCommitmentsIndicesCorrect tests rather than at runtime here.
524+
auto erase_range = [&](size_t duplicate_start, [[maybe_unused]] size_t original_start, size_t count) {
521525
for (size_t i = 0; i < count; ++i) {
522-
// Verify the commitment being erased matches its original (native only).
523-
// Each erase shifts elements down, so duplicate_start always points to the
524-
// next duplicate; the original at original_start + i is unaffected since
525-
// we erase higher-index ranges first.
526-
if constexpr (!Curve::is_stdlib_type) {
527-
if (commitments[duplicate_start] != commitments[original_start + i]) {
528-
throw_or_abort("remove_repeated_commitments: commitment mismatch at duplicate index " +
529-
std::to_string(duplicate_start) + " vs original index " +
530-
std::to_string(original_start + i));
531-
}
532-
}
533526
scalars.erase(scalars.begin() + static_cast<std::ptrdiff_t>(duplicate_start));
534527
commitments.erase(commitments.begin() + static_cast<std::ptrdiff_t>(duplicate_start));
535528
}

barretenberg/cpp/src/barretenberg/dsl/acir_format/gate_count_constants.hpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ template <typename Builder> inline constexpr size_t ASSERT_EQUALITY = ZERO_GATE
5555
// Honk Recursion Constants
5656
// ========================================
5757

58-
inline constexpr size_t ROOT_ROLLUP_GATE_COUNT = 12904885;
58+
inline constexpr size_t ROOT_ROLLUP_GATE_COUNT = 12904895;
5959

6060
template <typename RecursiveFlavor>
6161
constexpr std::tuple<size_t, size_t> HONK_RECURSION_CONSTANTS(
@@ -67,40 +67,40 @@ constexpr std::tuple<size_t, size_t> HONK_RECURSION_CONSTANTS(
6767
if constexpr (std::is_same_v<RecursiveFlavor, bb::UltraRecursiveFlavor_<UltraCircuitBuilder>>) {
6868
switch (mode) {
6969
case PredicateTestCase::ConstantTrue:
70-
return std::make_tuple(681762, 0);
70+
return std::make_tuple(681767, 0);
7171
case PredicateTestCase::WitnessTrue:
7272
case PredicateTestCase::WitnessFalse:
73-
return std::make_tuple(682819, 0);
73+
return std::make_tuple(682824, 0);
7474
}
7575
} else if constexpr (std::is_same_v<RecursiveFlavor, bb::UltraZKRecursiveFlavor_<UltraCircuitBuilder>>) {
7676
switch (mode) {
7777
case PredicateTestCase::ConstantTrue:
78-
return std::make_tuple(703917, 0);
78+
return std::make_tuple(703922, 0);
7979
case PredicateTestCase::WitnessTrue:
8080
case PredicateTestCase::WitnessFalse:
81-
return std::make_tuple(705070, 0);
81+
return std::make_tuple(705075, 0);
8282
}
8383
} else if constexpr (std::is_same_v<RecursiveFlavor, bb::UltraRecursiveFlavor_<MegaCircuitBuilder>>) {
8484
switch (mode) {
8585
case PredicateTestCase::ConstantTrue:
86-
return std::make_tuple(20909, 73);
86+
return std::make_tuple(20914, 73);
8787
case PredicateTestCase::WitnessTrue:
8888
case PredicateTestCase::WitnessFalse:
89-
return std::make_tuple(21966, 73);
89+
return std::make_tuple(21971, 73);
9090
}
9191
} else if constexpr (std::is_same_v<RecursiveFlavor, bb::UltraZKRecursiveFlavor_<MegaCircuitBuilder>>) {
9292
switch (mode) {
9393
case PredicateTestCase::ConstantTrue:
94-
return std::make_tuple(25476, 77);
94+
return std::make_tuple(25481, 77);
9595
case PredicateTestCase::WitnessTrue:
9696
case PredicateTestCase::WitnessFalse:
97-
return std::make_tuple(26629, 77);
97+
return std::make_tuple(26634, 77);
9898
}
9999
} else if constexpr (std::is_same_v<RecursiveFlavor, bb::MegaZKRecursiveFlavor_<UltraCircuitBuilder>>) {
100100
if (mode != PredicateTestCase::ConstantTrue) {
101101
bb::assert_failure("Unhandled mode in MegaZKRecursiveFlavor.");
102102
}
103-
return std::make_tuple(781910, 0);
103+
return std::make_tuple(781915, 0);
104104
} else {
105105
bb::assert_failure("Unhandled recursive flavor.");
106106
}
@@ -113,7 +113,7 @@ constexpr std::tuple<size_t, size_t> HONK_RECURSION_CONSTANTS(
113113
// ========================================
114114

115115
// Gate count for Chonk recursive verification (Ultra with RollupIO)
116-
inline constexpr size_t CHONK_RECURSION_GATES = 1491408;
116+
inline constexpr size_t CHONK_RECURSION_GATES = 1491593;
117117

118118
// ========================================
119119
// Hypernova Recursion Constants
@@ -123,22 +123,22 @@ inline constexpr size_t CHONK_RECURSION_GATES = 1491408;
123123
inline constexpr size_t MSM_ROWS_OFFSET = 2;
124124

125125
// Init kernel gate counts (verifies OINK proof)
126-
inline constexpr size_t INIT_KERNEL_GATE_COUNT = 25027;
126+
inline constexpr size_t INIT_KERNEL_GATE_COUNT = 25032;
127127
inline constexpr size_t INIT_KERNEL_ECC_ROWS = 848 + MSM_ROWS_OFFSET;
128128
inline constexpr size_t INIT_KERNEL_ULTRA_OPS = 89;
129129

130130
// Inner kernel gate counts (verifies HN proof for previous kernel + HN for app)
131-
inline constexpr size_t INNER_KERNEL_GATE_COUNT_HN = 60487;
131+
inline constexpr size_t INNER_KERNEL_GATE_COUNT_HN = 60497;
132132
inline constexpr size_t INNER_KERNEL_ECC_ROWS = 1700 + MSM_ROWS_OFFSET;
133133
inline constexpr size_t INNER_KERNEL_ULTRA_OPS = 179;
134134

135135
// Tail kernel gate counts (verifies HN_TAIL proof)
136-
inline constexpr size_t TAIL_KERNEL_GATE_COUNT = 32868;
136+
inline constexpr size_t TAIL_KERNEL_GATE_COUNT = 32873;
137137
inline constexpr size_t TAIL_KERNEL_ECC_ROWS = 914 + MSM_ROWS_OFFSET;
138138
inline constexpr size_t TAIL_KERNEL_ULTRA_OPS = 96;
139139

140140
// Hiding kernel gate counts (verifies HN_FINAL proof)
141-
inline constexpr size_t HIDING_KERNEL_GATE_COUNT = 36265;
141+
inline constexpr size_t HIDING_KERNEL_GATE_COUNT = 36270;
142142
inline constexpr size_t HIDING_KERNEL_ECC_ROWS = 1407 + MSM_ROWS_OFFSET;
143143
inline constexpr size_t HIDING_KERNEL_ULTRA_OPS = 127;
144144

@@ -147,7 +147,7 @@ inline constexpr size_t HIDING_KERNEL_ULTRA_OPS = 127;
147147
// ========================================
148148

149149
// Gate count for ECCVM recursive verifier (Ultra-arithmetized)
150-
inline constexpr size_t ECCVM_RECURSIVE_VERIFIER_GATE_COUNT = 224162;
150+
inline constexpr size_t ECCVM_RECURSIVE_VERIFIER_GATE_COUNT = 224336;
151151

152152
// ========================================
153153
// Goblin AVM Recursive Verifier Constants

barretenberg/cpp/src/barretenberg/dsl/acir_format/logic_constraint.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ void create_logic_gate(Builder& builder,
2323
field_ct right = to_field_ct(b, builder);
2424

2525
field_ct computed_result = bb::stdlib::logic<Builder>::create_logic_constraint(left, right, num_bits, is_xor_gate);
26+
27+
// In write-VK mode the result witness holds a dummy zero. In certain cases, the computed result is non-zero so the
28+
// assert_equal would spuriously fail. Patch the witness value so the downstream assertion sees the correct value.
29+
// Eg. for an XOR gate, if the inputs are constants such that the result is a non-zero constant, the assert_equal
30+
// will fail in write-VK mode since the result witness is initialized to zero.
31+
if (builder.is_write_vk_mode()) {
32+
builder.set_variable(result, computed_result.get_value());
33+
}
34+
2635
field_ct acir_result = field_ct::from_witness_index(&builder, result);
2736
computed_result.assert_equal(acir_result);
2837
}

barretenberg/cpp/src/barretenberg/dsl/acir_format/logic_constraint.test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ class LogicConstraintTestingFunctions {
7373
return WitnessOrConstant<FF>::from_index(input_index);
7474
};
7575

76-
bb::fr lhs = FF(static_cast<uint256_t>(1) << num_bits - 1); // All bits from 0 to num_bits-1 are set
77-
bb::fr rhs = FF(static_cast<uint256_t>(1) << num_bits - 1); // All bits from 0 to num_bits-1 are set
76+
bb::fr lhs = FF((static_cast<uint256_t>(1) << num_bits) - 1); // All bits from 0 to num_bits-1 are set
77+
bb::fr rhs = FF((static_cast<uint256_t>(1) << num_bits) - 1); // All bits from 0 to num_bits-1 are set
7878
bb::fr result = is_xor_gate ? (static_cast<uint256_t>(lhs) ^ static_cast<uint256_t>(rhs))
7979
: (static_cast<uint256_t>(lhs) & static_cast<uint256_t>(rhs));
8080

barretenberg/cpp/src/barretenberg/dsl/acir_proofs/honk_contract.hpp

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ function equal(Fr a, Fr b) pure returns (bool) {
198198
199199
uint256 constant CONST_PROOF_SIZE_LOG_N = 25;
200200
201-
uint256 constant NUMBER_OF_SUBRELATIONS = 28;
201+
uint256 constant NUMBER_OF_SUBRELATIONS = 29;
202202
uint256 constant BATCHED_RELATION_PARTIAL_LENGTH = 8;
203203
uint256 constant ZK_BATCHED_RELATION_PARTIAL_LENGTH = 9;
204204
uint256 constant NUMBER_OF_ENTITIES = 41;
@@ -870,6 +870,12 @@ library RelationsLib {
870870
Fr acc = (wire(p, WIRE.LAGRANGE_LAST) * wire(p, WIRE.Z_PERM_SHIFT)) * domainSep;
871871
evals[3] = acc;
872872
}
873+
874+
// Contribution 4: z_perm initialization check (lagrange_first * z_perm = 0)
875+
{
876+
Fr acc = (wire(p, WIRE.LAGRANGE_FIRST) * wire(p, WIRE.Z_PERM)) * domainSep;
877+
evals[4] = acc;
878+
}
873879
}
874880
875881
function accumulateLogDerivativeLookupRelation(
@@ -919,9 +925,9 @@ library RelationsLib {
919925
920926
Fr read_tag_boolean_relation = read_tag * read_tag - read_tag;
921927
922-
evals[4] = accumulatorNone;
923-
evals[5] = accumulatorOne;
924-
evals[6] = read_tag_boolean_relation * domainSep;
928+
evals[5] = accumulatorNone;
929+
evals[6] = accumulatorOne;
930+
evals[7] = read_tag_boolean_relation * domainSep;
925931
}
926932
927933
function accumulateDeltaRangeRelation(
@@ -947,7 +953,7 @@ library RelationsLib {
947953
acc = acc * (delta_1 + minus_three);
948954
acc = acc * wire(p, WIRE.Q_RANGE);
949955
acc = acc * domainSep;
950-
evals[7] = acc;
956+
evals[8] = acc;
951957
}
952958
953959
// Contribution 7
@@ -958,7 +964,7 @@ library RelationsLib {
958964
acc = acc * (delta_2 + minus_three);
959965
acc = acc * wire(p, WIRE.Q_RANGE);
960966
acc = acc * domainSep;
961-
evals[8] = acc;
967+
evals[9] = acc;
962968
}
963969
964970
// Contribution 8
@@ -969,7 +975,7 @@ library RelationsLib {
969975
acc = acc * (delta_3 + minus_three);
970976
acc = acc * wire(p, WIRE.Q_RANGE);
971977
acc = acc * domainSep;
972-
evals[9] = acc;
978+
evals[10] = acc;
973979
}
974980
975981
// Contribution 9
@@ -980,7 +986,7 @@ library RelationsLib {
980986
acc = acc * (delta_4 + minus_three);
981987
acc = acc * wire(p, WIRE.Q_RANGE);
982988
acc = acc * domainSep;
983-
evals[10] = acc;
989+
evals[11] = acc;
984990
}
985991
}
986992
@@ -1015,7 +1021,7 @@ library RelationsLib {
10151021
x_add_identity = x_add_identity * x_diff * x_diff;
10161022
x_add_identity = x_add_identity - y2_sqr - y1_sqr + y1y2 + y1y2;
10171023
1018-
evals[11] = x_add_identity * partialEval * wire(p, WIRE.Q_ELLIPTIC) * (ONE - q_is_double);
1024+
evals[12] = x_add_identity * partialEval * wire(p, WIRE.Q_ELLIPTIC) * (ONE - q_is_double);
10191025
}
10201026
10211027
// Contribution 11 point addition, x-coordinate check
@@ -1024,7 +1030,7 @@ library RelationsLib {
10241030
Fr y1_plus_y3 = ep.y_1 + ep.y_3;
10251031
Fr y_diff = ep.y_2 * q_sign - ep.y_1;
10261032
Fr y_add_identity = y1_plus_y3 * x_diff + (ep.x_3 - ep.x_1) * y_diff;
1027-
evals[12] = y_add_identity * domainSep * wire(p, WIRE.Q_ELLIPTIC) * (ONE - q_is_double);
1033+
evals[13] = y_add_identity * domainSep * wire(p, WIRE.Q_ELLIPTIC) * (ONE - q_is_double);
10281034
}
10291035
10301036
// Contribution 10 point doubling, x-coordinate check
@@ -1040,15 +1046,15 @@ library RelationsLib {
10401046
ep.x_double_identity = (ep.x_3 + ep.x_1 + ep.x_1) * y1_sqr_mul_4 - x1_pow_4_mul_9;
10411047
10421048
Fr acc = ep.x_double_identity * domainSep * wire(p, WIRE.Q_ELLIPTIC) * q_is_double;
1043-
evals[11] = evals[11] + acc;
1049+
evals[12] = evals[12] + acc;
10441050
}
10451051
10461052
// Contribution 11 point doubling, y-coordinate check
10471053
// (y1 + y1) (2y1) - (3 * x1 * x1)(x1 - x3) = 0
10481054
{
10491055
Fr x1_sqr_mul_3 = (ep.x_1 + ep.x_1 + ep.x_1) * ep.x_1;
10501056
Fr y_double_identity = x1_sqr_mul_3 * (ep.x_1 - ep.x_3) - (ep.y_1 + ep.y_1) * (ep.y_1 + ep.y_3);
1051-
evals[12] = evals[12] + y_double_identity * domainSep * wire(p, WIRE.Q_ELLIPTIC) * q_is_double;
1057+
evals[13] = evals[13] + y_double_identity * domainSep * wire(p, WIRE.Q_ELLIPTIC) * q_is_double;
10521058
}
10531059
}
10541060
@@ -1135,9 +1141,9 @@ library RelationsLib {
11351141
11361142
ap.adjacent_values_match_if_adjacent_indices_match = (ap.index_delta * MINUS_ONE + ONE) * ap.record_delta; // deg 2
11371143
1138-
evals[14] = ap.adjacent_values_match_if_adjacent_indices_match * (wire(p, WIRE.Q_L) * wire(p, WIRE.Q_R))
1144+
evals[15] = ap.adjacent_values_match_if_adjacent_indices_match * (wire(p, WIRE.Q_L) * wire(p, WIRE.Q_R))
11391145
* (wire(p, WIRE.Q_MEMORY) * domainSep); // deg 5
1140-
evals[15] = ap.index_is_monotonically_increasing * (wire(p, WIRE.Q_L) * wire(p, WIRE.Q_R))
1146+
evals[16] = ap.index_is_monotonically_increasing * (wire(p, WIRE.Q_L) * wire(p, WIRE.Q_R))
11411147
* (wire(p, WIRE.Q_MEMORY) * domainSep); // deg 5
11421148
11431149
ap.ROM_consistency_check_identity = ap.memory_record_check * (wire(p, WIRE.Q_L) * wire(p, WIRE.Q_R)); // deg 3 or 7
@@ -1184,10 +1190,10 @@ library RelationsLib {
11841190
ap.next_gate_access_type * ap.next_gate_access_type - ap.next_gate_access_type;
11851191
11861192
// Putting it all together...
1187-
evals[16] = ap.adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation
1193+
evals[17] = ap.adjacent_values_match_if_adjacent_indices_match_and_next_access_is_a_read_operation
11881194
* (wire(p, WIRE.Q_O)) * (wire(p, WIRE.Q_MEMORY) * domainSep); // deg 5 or 8
1189-
evals[17] = ap.index_is_monotonically_increasing * (wire(p, WIRE.Q_O)) * (wire(p, WIRE.Q_MEMORY) * domainSep); // deg 4
1190-
evals[18] = ap.next_gate_access_type_is_boolean * (wire(p, WIRE.Q_O)) * (wire(p, WIRE.Q_MEMORY) * domainSep); // deg 4 or 6
1195+
evals[18] = ap.index_is_monotonically_increasing * (wire(p, WIRE.Q_O)) * (wire(p, WIRE.Q_MEMORY) * domainSep); // deg 4
1196+
evals[19] = ap.next_gate_access_type_is_boolean * (wire(p, WIRE.Q_O)) * (wire(p, WIRE.Q_MEMORY) * domainSep); // deg 4 or 6
11911197
11921198
ap.RAM_consistency_check_identity = ap.access_check * (wire(p, WIRE.Q_O)); // deg 3 or 9
11931199
@@ -1218,7 +1224,7 @@ library RelationsLib {
12181224
12191225
// (deg 3 or 9) + (deg 4) + (deg 3)
12201226
ap.memory_identity = ap.memory_identity * (wire(p, WIRE.Q_MEMORY) * domainSep); // deg 4 or 10
1221-
evals[13] = ap.memory_identity;
1227+
evals[14] = ap.memory_identity;
12221228
}
12231229
12241230
function accumulateNnfRelation(
@@ -1294,7 +1300,7 @@ library RelationsLib {
12941300
12951301
ap.nnf_identity = non_native_field_identity + limb_accumulator_identity;
12961302
ap.nnf_identity = ap.nnf_identity * (wire(p, WIRE.Q_NNF) * domainSep);
1297-
evals[19] = ap.nnf_identity;
1303+
evals[20] = ap.nnf_identity;
12981304
}
12991305
13001306
function accumulatePoseidonExternalRelation(
@@ -1330,13 +1336,13 @@ library RelationsLib {
13301336
ep.v3 = ep.t2 + ep.v4; // u_1 + 3u_2 + 5u_3 + 7u_4
13311337
13321338
ep.q_pos_by_scaling = wire(p, WIRE.Q_POSEIDON2_EXTERNAL) * domainSep;
1333-
evals[20] = evals[20] + ep.q_pos_by_scaling * (ep.v1 - wire(p, WIRE.W_L_SHIFT));
1339+
evals[21] = evals[21] + ep.q_pos_by_scaling * (ep.v1 - wire(p, WIRE.W_L_SHIFT));
13341340
1335-
evals[21] = evals[21] + ep.q_pos_by_scaling * (ep.v2 - wire(p, WIRE.W_R_SHIFT));
1341+
evals[22] = evals[22] + ep.q_pos_by_scaling * (ep.v2 - wire(p, WIRE.W_R_SHIFT));
13361342
1337-
evals[22] = evals[22] + ep.q_pos_by_scaling * (ep.v3 - wire(p, WIRE.W_O_SHIFT));
1343+
evals[23] = evals[23] + ep.q_pos_by_scaling * (ep.v3 - wire(p, WIRE.W_O_SHIFT));
13381344
1339-
evals[23] = evals[23] + ep.q_pos_by_scaling * (ep.v4 - wire(p, WIRE.W_4_SHIFT));
1345+
evals[24] = evals[24] + ep.q_pos_by_scaling * (ep.v4 - wire(p, WIRE.W_4_SHIFT));
13401346
}
13411347
13421348
function accumulatePoseidonInternalRelation(
@@ -1368,16 +1374,16 @@ library RelationsLib {
13681374
ip.q_pos_by_scaling = wire(p, WIRE.Q_POSEIDON2_INTERNAL) * domainSep;
13691375
13701376
ip.v1 = ip.u1 * INTERNAL_MATRIX_DIAGONAL[0] + ip.u_sum;
1371-
evals[24] = evals[24] + ip.q_pos_by_scaling * (ip.v1 - wire(p, WIRE.W_L_SHIFT));
1377+
evals[25] = evals[25] + ip.q_pos_by_scaling * (ip.v1 - wire(p, WIRE.W_L_SHIFT));
13721378
13731379
ip.v2 = ip.u2 * INTERNAL_MATRIX_DIAGONAL[1] + ip.u_sum;
1374-
evals[25] = evals[25] + ip.q_pos_by_scaling * (ip.v2 - wire(p, WIRE.W_R_SHIFT));
1380+
evals[26] = evals[26] + ip.q_pos_by_scaling * (ip.v2 - wire(p, WIRE.W_R_SHIFT));
13751381
13761382
ip.v3 = ip.u3 * INTERNAL_MATRIX_DIAGONAL[2] + ip.u_sum;
1377-
evals[26] = evals[26] + ip.q_pos_by_scaling * (ip.v3 - wire(p, WIRE.W_O_SHIFT));
1383+
evals[27] = evals[27] + ip.q_pos_by_scaling * (ip.v3 - wire(p, WIRE.W_O_SHIFT));
13781384
13791385
ip.v4 = ip.u4 * INTERNAL_MATRIX_DIAGONAL[3] + ip.u_sum;
1380-
evals[27] = evals[27] + ip.q_pos_by_scaling * (ip.v4 - wire(p, WIRE.W_4_SHIFT));
1386+
evals[28] = evals[28] + ip.q_pos_by_scaling * (ip.v4 - wire(p, WIRE.W_4_SHIFT));
13811387
}
13821388
13831389
// Batch subrelation evaluations using precomputed powers of alpha

0 commit comments

Comments
 (0)