On Tue, May 28, 2019 at 09:40:55AM -0700, Eric Biggers wrote: > From: Eric Biggers <ebiggers@xxxxxxxxxx> > > For hash algorithms implemented using the "shash" algorithm type, test > both the ahash and shash APIs, not just the ahash API. > > Testing the ahash API already tests the shash API indirectly, which is > normally good enough. However, there have been corner cases where there > have been shash bugs that don't get exposed through the ahash API. So, > update testmgr to test the shash API too. > > This would have detected the arm64 SHA-1 and SHA-2 bugs for which fixes > were just sent out (https://patchwork.kernel.org/patch/10964843/ and > https://patchwork.kernel.org/patch/10965089/): > > alg: shash: sha1-ce test failed (wrong result) on test vector 0, cfg="init+finup aligned buffer" > alg: shash: sha224-ce test failed (wrong result) on test vector 0, cfg="init+finup aligned buffer" > alg: shash: sha256-ce test failed (wrong result) on test vector 0, cfg="init+finup aligned buffer" > > This also would have detected the bugs fixed by commit 307508d10729 > ("crypto: crct10dif-generic - fix use via crypto_shash_digest()") and > commit dec3d0b1071a > ("crypto: x86/crct10dif-pcl - fix use via crypto_shash_digest()"). > > Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx> > Acked-by: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx> > --- > crypto/testmgr.c | 402 +++++++++++++++++++++++++++++++++++++++-------- > 1 file changed, 335 insertions(+), 67 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt