Commit 7cfb890
docs(xmss): document verify() length-validation guards (#1121)
The verify() docstring enumerated the slot bound-check, codeword
recomputation, chain completion, and Merkle rebuild, but omitted the two
length-validation guards the body performs first: an exact-length check on
the released hashes and on the path siblings.
These guards defend against the SSZ offset-spoofing attack, where an
equal-length byte string decodes into a list of the wrong arity. A
malformed length now returns False up front, before the per-chain loop can
index out of range.
Add an explicit phase to the docstring for these guards and renumber the
later phases so the docstring and the body phase labels stay one-to-one.
Documentation only; no behavior change.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0c4b0ae commit 7cfb890
1 file changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
291 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
292 | 295 | | |
293 | 296 | | |
294 | 297 | | |
| |||
315 | 318 | | |
316 | 319 | | |
317 | 320 | | |
| 321 | + | |
318 | 322 | | |
319 | 323 | | |
320 | 324 | | |
| |||
327 | 331 | | |
328 | 332 | | |
329 | 333 | | |
330 | | - | |
| 334 | + | |
331 | 335 | | |
332 | 336 | | |
333 | 337 | | |
| |||
344 | 348 | | |
345 | 349 | | |
346 | 350 | | |
347 | | - | |
| 351 | + | |
348 | 352 | | |
349 | 353 | | |
350 | 354 | | |
| |||
0 commit comments