Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0a7318a authored by Eric Biggers's avatar Eric Biggers Committed by Ram Muthiah
Browse files

UPSTREAM: crypto: testmgr - fix testing OPTIONAL_KEY hash algorithms



Since testmgr uses a single tfm for all tests of each hash algorithm,
once a key is set the tfm won't be unkeyed anymore.  But with crc32 and
crc32c, the key is really the "default initial state" and is optional;
those algorithms should have both keyed and unkeyed test vectors, to
verify that implementations use the correct default key.

Simply listing the unkeyed test vectors first isn't guaranteed to work
yet because testmgr makes multiple passes through the test vectors.
crc32c does have an unkeyed test vector listed first currently, but it
only works by chance because the last crc32c test vector happens to use
a key that is the same as the default key.

Therefore, teach testmgr to split hash test vectors into unkeyed and
keyed sections, and do all the unkeyed ones before the keyed ones.

Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>

(cherry picked from commit a1afe27492a408d45421a1812064235691303fa1)
Bug: 248322249
Change-Id: I0c8e5e36f0de29351a97a479d2f59a7b5b8b27d8
Signed-off-by: default avatarRam Muthiah <rammuthiah@google.com>
parent f2a4c8b5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment