Commit a1cf282
k256: debug_assert wNAF digit index stays in bounds
`wnaf_128` writes into a fixed 130-entry buffer; the bound holds for the
current `WNAF_WIDTH = 5` and the ≤128-bit GLV sub-scalars, but it's
implicit. Add a `debug_assert!` in the loop so that any future change to
`WNAF_WIDTH` that invalidates the bound is caught at test time rather
than silently writing out of bounds in worst-case inputs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 4785280 commit a1cf282
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
346 | 347 | | |
347 | 348 | | |
348 | 349 | | |
| |||
0 commit comments