Commit 17f53e8a authored by Eric Biggers's avatar Eric Biggers Committed by William McVicker
Browse files

FROMLIST: crypto: testmgr - generate power-of-2 lengths more often



Implementations of hash functions often have special cases when lengths
are a multiple of the hash function's internal block size (e.g. 64 for
SHA-256, 128 for SHA-512).  Currently, when the fuzz testing code
generates lengths, it doesn't prefer any length mod 64 over any other.
This limits the coverage of these special cases.

Therefore, this patch updates the fuzz testing code to generate
power-of-2 lengths and divide messages exactly in half a bit more often.

Reviewed-by: default avatarSami Tolvanen <samitolvanen@google.com>
Acked-by: default avatarArd Biesheuvel <ardb@kernel.org>
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>

Bug: 330611177
Link: https://lore.kernel.org/r/20240621165922.77672-3-ebiggers@kernel.org


Change-Id: I76425c0136cf3beb161855cb77ec383ece1545db
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
parent 614beb21
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment