crypto: testmgr - test in-place en/decryption with two sglists
authorEric Biggers <ebiggers@google.com>
Sat, 26 Mar 2022 07:11:59 +0000 (00:11 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 8 Apr 2022 08:25:19 +0000 (16:25 +0800)
commitf17f9e9069f20f4400ae0bb3ee830d34104ff8f7
tree8da45b390dccac99e638d680c35b25e1c182c1a3
parentf16a005cde3b1f31cad5ecba0cc810652c3874ec
crypto: testmgr - test in-place en/decryption with two sglists

As was established in the thread
https://lore.kernel.org/linux-crypto/20220223080400.139367-1-gilad@benyossef.com/T/#u,
many crypto API users doing in-place en/decryption don't use the same
scatterlist pointers for the source and destination, but rather use
separate scatterlists that point to the same memory.  This case isn't
tested by the self-tests, resulting in bugs.

This is the natural usage of the crypto API in some cases, so requiring
API users to avoid this usage is not reasonable.

Therefore, update the self-tests to start testing this case.

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