AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 15 Bitcoin

hashes: Add chunk-combination tests

Public commit record

What the developer wrote

Authored by jrakibi

86/100 · Strong
hashes: Add chunk-combination tests

For a hash with block size B, we build a deterministic byte array of size
`3 * (B + 1)` and test every (i, j, k) combination in `0..=B` across three
engine.input() calls.
This will help us catch streaming bugs that incremental byte-by-byte checks can miss,
especially block-boundary transitions, empty chunks, and buffering bugs. 

inspired by `ring` `test_i_u_f` tests:
https://github.com/briansmith/ring/commit/5daff2c0e1bb8ef00e44e15b0531dda0b69d0ec5


These tests are slow (`(B + 1)^3` combinations per algo) so I put them to
run only in release mode
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit only adds new test code. It does not change any production hashing logic, fix a bug, or introduce a vulnerability. The new tests verify that feeding data to hash engines in three chunks of varying sizes produces the same result as hashing the same data all at once, which helps catch streaming bugs in the future but is not itself a security change.

Recommended action

No security action required. This is a test-only addition. Reviewers may optionally confirm the tests pass in release mode and that the block sizes listed match each hash algorithm's specification.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.