Skip to content

Fix a missing part of the Burnikel-Ziegler algorithm#348

Merged
cuviper merged 3 commits into
rust-num:masterfrom
cuviper:bz-alg2-step3b
Jul 5, 2026
Merged

Fix a missing part of the Burnikel-Ziegler algorithm#348
cuviper merged 3 commits into
rust-num:masterfrom
cuviper:bz-alg2-step3b

Conversation

@cuviper

@cuviper cuviper commented Jul 5, 2026

Copy link
Copy Markdown
Member

When this algorithm was implemented in #316, it missed the condition described in the paper under Algorithm 2 step 3, and thus could lead to a precondition assertion failure. This condition is now implemented.

This regression was found by OSS Fuzz: https://issues.oss-fuzz.com/issues/531153120

@cuviper cuviper enabled auto-merge July 5, 2026 01:03
@cuviper cuviper added this pull request to the merge queue Jul 5, 2026
Merged via the queue into rust-num:master with commit 33c59ba Jul 5, 2026
4 checks passed
lucifer1004 added a commit to lucifer1004/farkas that referenced this pull request Jul 5, 2026
0.4.7's new Burnikel-Ziegler division misses the Algorithm 2 step 3
condition (rust-num/num-bigint#348, found by OSS-Fuzz) and can
mis-divide or crash when the dividend exceeds ~8192 bits with a divisor
over ~4096 bits. That is beyond any operand size this workload has been
observed to produce, but the daemon accepts arbitrary input, so take
the fix before the first crates.io publish. The v4.31.0-farkas.1 tag
and release are re-cut on this commit (pre-announcement, no consumers).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cuviper cuviper deleted the bz-alg2-step3b branch July 5, 2026 22:42
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.

1 participant