]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: testmgr - fix testing OPTIONAL_KEY hash algorithms
authorEric Biggers <ebiggers@google.com>
Sun, 20 May 2018 05:07:41 +0000 (22:07 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 26 May 2018 16:12:10 +0000 (00:12 +0800)
commitb04a1df0bded1c63764212ff8c1e55c615aa7d69
tree6592dc0b3db3c524df502c8c7e2ff746bdcfc577
parent15ebaaf38169c65b9268c5958c214ac3922ec3e1
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: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/testmgr.c