OSDN Git Service

crypto: testmgr - convert aead testing to use testvec_configs
authorEric Biggers <ebiggers@google.com>
Fri, 1 Feb 2019 07:51:47 +0000 (23:51 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 8 Feb 2019 07:30:09 +0000 (15:30 +0800)
commited96804ff1a5f94bdf4cda73ee81ba4545a076e5
treeb4833b14763c9899f9b75ce06c1f2d5f17ecf6f4
parent4e7babba30d820c4195b1d58cf51dce3c22ecf2b
crypto: testmgr - convert aead testing to use testvec_configs

Convert alg_test_aead() to use the new test framework, using the same
list of testvec_configs that skcipher testing uses.

This significantly improves AEAD test coverage mainly because previously
there was only very limited test coverage of the possible data layouts.
Now the data layouts to test are listed in one place for all algorithms
and optionally are also randomly generated.  In fact, only one AEAD
algorithm (AES-GCM) even had a chunked test case before.

This already found bugs in all the AEGIS and MORUS implementations, the
x86 AES-GCM implementation, and the arm64 AES-CCM implementation.

I removed the AEAD chunked test vectors that were the same as
non-chunked ones, but left the ones that were unique.

Note: the rewritten test code allocates an aead_request just once per
algorithm rather than once per encryption/decryption, but some AEAD
algorithms incorrectly change the tfm pointer in the request.  It's
nontrivial to fix these, so to move forward I'm temporarily working
around it by resetting the tfm pointer.  But they'll need to be fixed.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/testmgr.c
crypto/testmgr.h