Skip to content

Conversation

@ledwards2225
Copy link
Contributor

@ledwards2225 ledwards2225 commented Jan 9, 2026

In the constructor of a cycle_scalar from a bigfield element, limb1 is split across the lo and hi slices of the scalar. If the max value of limb1 is such that the limb fits entirely in the lo slice, calling no_wrap_split_at would result in an assertion failure (i.e. BB_ASSERT(lsb_index < num_bits);). This PR introduces handling for this edge case by checking this condition first then setting the hi slice contribution of limb1 to 0 if needed.

@ledwards2225 ledwards2225 marked this pull request as ready for review January 9, 2026 20:59
@ledwards2225 ledwards2225 requested a review from suyash67 January 12, 2026 15:29
Copy link
Contributor

@suyash67 suyash67 left a comment

Choose a reason for hiding this comment

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

Looks good. Nice catch!

@ledwards2225 ledwards2225 merged commit 65f4d0a into merge-train/barretenberg Jan 13, 2026
12 of 13 checks passed
@ledwards2225 ledwards2225 deleted the lde/cg-fix branch January 13, 2026 18:32
github-merge-queue bot pushed a commit that referenced this pull request Jan 14, 2026
BEGIN_COMMIT_OVERRIDE
chore: Improve Chonk debug info (#19538)
chore: translator non-native and decomp relations audit (#19081)
chore: add safety to derive_generators and tweak pedersen scope (#19525)
fix: ci-barretenberg-full mode fixes (#19466)
test: use WASM backend for bbjs-test acir tests (#19529)
fix: use absolute path in run_test.sh for CI
fix: use env_objects in bb-external library
fix: completeness issue in cycle scalar constructor from bigfield
(#19475)
chore: review a few minor files for ultra/mega audit (#19513)
END_COMMIT_OVERRIDE
github-actions bot pushed a commit that referenced this pull request Jan 14, 2026
…9475)

In the constructor of a cycle_scalar from a bigfield element, limb1 is
split across the lo and hi slices of the scalar. If the max value of
limb1 is such that the limb fits entirely in the lo slice, calling
`no_wrap_split_at` would result in an assertion failure (i.e.
`BB_ASSERT(lsb_index < num_bits);`). This PR introduces handling for
this edge case by checking this condition first then setting the hi
slice contribution of limb1 to 0 if needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants