[Cryptographic_Clang] Fix lost borrow in bignum_subtract when a limb is 0xFFFFFFFF
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 79/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- cpp
- 領域
- cryptography
調査の方向性
Security_Algorithms/Cryptographic_Clang/bignum.cを読み、bignum_subtractと、各limbの差および借りをどのように計算するかに注目してください。limbに0xFFFFFFFFを含むオペランドで不具合を再現し、その後、issueに記載されたランダムな恒等性チェックとPythonによる差分チェックを実行してください。両方のチェックが誤った減算なしで成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
bignum_subtract computes the borrow from temp = carry + b2->data[i] in 32 bits. When the incoming borrow is 1 and the limb of b2 is 0xFFFFFFFF, temp wraps to 0, the limb difference is computed against 0 and the borrow is lost. RSA key generation uses subtraction (p - 1, q - 1), so wrong results can propagate into phi.
Location
Security_Algorithms/Cryptographic_Clang/bignum.c(bignum_subtract)
Evidence
Differential test against Python integers, 3,000 random operands biased towards 0xFFFFFFFF limbs: 379 subtractions wrong. Found while fixing #136 and #137.
Expected
(a + b) - b == a for all operands with a >= b.
Proposed fix
Accumulate the subtrahend limb plus borrow in 64 bits and derive the borrow from that comparison.
Acceptance criteria
- Random identity test
(a + b) - b == apasses for 20,000 operands - Differential test against Python reports no wrong subtraction
Found while fixing the bignum issues · Phase 3 · Build & correctness
Generated by Claude Code
- 主要言語
- C++
- スター
- 2
- フォーク
- 1
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ibra-kdbra/Math-Problems のほかの issue
-
area: math-chaos priority: P3 size: S type: enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ibra-kdbra/Math-Problems#397 ·
-
area: docs-site good first issue priority: P3 size: XS type: chore
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ibra-kdbra/Math-Problems#379 ·
-
area: docs-site good first issue priority: P3 size: XS type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
ibra-kdbra/Math-Problems#378 ·
-
area: docs-site good first issue priority: P2 size: XS type: chore
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ibra-kdbra/Math-Problems#367 ·
-
area: docs-site good first issue priority: P2 size: XS type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ibra-kdbra/Math-Problems#366 ·
ibra-kdbra/Math-Problems の issue をすべて見る
似ている issue
-
Flow Needs: Triage :mag:
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
react/react-native#60447 ·
メンテナーはふだん 1 日以内に返信
-
bug documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
TransformInteract: a circle drag through the centre sets Scale to its minimum, which can't grow backオープンdifficulty:easy prio:low type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NatronGitHub/openfx-supportext#311 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
CachyOS/packageinstaller#211 ·
メンテナーはふだん 1 日以内に返信