summaryrefslogtreecommitdiff
path: root/crypto/testmgr.c
diff options
context:
space:
mode:
authorNathan Huckleberry <nhuck@google.com>2022-05-20 18:14:53 +0000
committerHerbert Xu <herbert@gondor.apana.org.au>2022-06-10 16:40:16 +0800
commit880d1ee81cdf5f2a4e070beab419c17865edfd24 (patch)
tree84b588ccaa880cac924dafcd6d613afbc1d6ca8b /crypto/testmgr.c
parent7fae17ead59ccd7e244e0871c8130951b138115f (diff)
downloadlinux-crypto-880d1ee81cdf5f2a4e070beab419c17865edfd24.tar.gz
linux-crypto-880d1ee81cdf5f2a4e070beab419c17865edfd24.zip
crypto: xctr - Add XCTR support
Add a generic implementation of XCTR mode as a template. XCTR is a blockcipher mode similar to CTR mode. XCTR uses XORs and little-endian addition rather than big-endian arithmetic which has two advantages: It is slightly faster on little-endian CPUs and it is less likely to be implemented incorrect since integer overflows are not possible on practical input sizes. XCTR is used as a component to implement HCTR2. More information on XCTR mode can be found in the HCTR2 paper: https://eprint.iacr.org/2021/1441.pdf Signed-off-by: Nathan Huckleberry <nhuck@google.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/testmgr.c')
-rw-r--r--crypto/testmgr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index 5801a8f9..0ea77dcd 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -5549,6 +5549,12 @@ static const struct alg_test_desc alg_test_descs[] = {
.cipher = __VECS(xchacha20_tv_template)
},
}, {
+ .alg = "xctr(aes)",
+ .test = alg_test_skcipher,
+ .suite = {
+ .cipher = __VECS(aes_xctr_tv_template)
+ }
+ }, {
.alg = "xts(aes)",
.generic_driver = "xts(ecb(aes-generic))",
.test = alg_test_skcipher,