]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: chacha20poly1305 - add back missing test vectors and test chunking
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 16 Jan 2020 20:26:34 +0000 (21:26 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 22 Jan 2020 08:21:11 +0000 (16:21 +0800)
commitf644e6054c9d1ba9401348b444eb1d17b3b18a8e
treebfd33eea1a9820e8fbb69f851ac6c4f5be481748
parentb97829629e8e8ba31ca439dcbcea8dc3c0255dc4
crypto: chacha20poly1305 - add back missing test vectors and test chunking

When this was originally ported, the 12-byte nonce vectors were left out
to keep things simple. I agree that we don't need nor want a library
interface for 12-byte nonces. But these test vectors were specially
crafted to look at issues in the underlying primitives and related
interactions.  Therefore, we actually want to keep around all of the
test vectors, and simply have a helper function to test them with.

Secondly, the sglist-based chunking code in the library interface is
rather complicated, so this adds a developer-only test for ensuring that
all the book keeping is correct, across a wide array of possibilities.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
lib/crypto/chacha20poly1305-selftest.c