Skip to content

Conversation

notnotraju
Copy link
Contributor

@notnotraju notnotraju commented Aug 25, 2025

wNAF relations is more-or-less completely audited, modulo the multiset equality stuff that happens in set_relation. This will also require fixing the docs in this file to actually accurately reflect what is being multiset-checked and why this is sufficient to (1) correctly constrain q_transition and round.

@@ -18,17 +18,18 @@ namespace bb {
* | point_transition | round | slices | skew | scalar_sum |
* | ---------------- | ----- | --------------- | ------ | ------------------------------- |
* | 0 | 0 | s0,s1,s2,s3 | 0 | 0 |
* | 0 | 1 | s4,s5,s6,s7 | 0 | \sum_{i=0}^4 16^i * s_{31 - i} |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formulas were wrong

@@ -173,17 +181,19 @@ void ECCVMWnafRelationImpl<FF>::accumulate(ContainerOverSubrelations& accumulato
// => q_transition * (round - 7 - round_shift + round + 1) + (round_shift - round - 1)
// => q_transition * (2 * round - round_shift - 6) + (round_shift - round - 1)
const auto round_check = round_shift - round - 1;
std::get<9>(accumulator) += precompute_select * scaled_transition * ((round - round_check - 7) + round_check);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this only checks scaled_transition != 0 implies that round == 7, corrected below to also check the increment if scaled_transition == 0.

@notnotraju notnotraju self-assigned this Aug 29, 2025
@notnotraju notnotraju added the bberg-int-audit All things related to barretenberg internal audit label Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bberg-int-audit All things related to barretenberg internal audit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant