OSDN Git Service

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

Convert alg_test_skcipher() to use the new test framework, adding a list
of testvec_configs to test by default.  When the extra self-tests are
enabled, randomly generated testvec_configs are tested as well.

This improves skcipher test coverage mainly because now all algorithms
have a variety of data layouts tested, whereas before each algorithm was
responsible for declaring its own chunked test cases which were often
missing or provided poor test coverage.  The new code also tests both
the MAY_SLEEP and !MAY_SLEEP cases, different IV alignments, and buffers
that cross pages.

This has already found a bug in the arm64 ctr-aes-neonbs algorithm.
It would have easily found many past bugs.

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

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