crypto: testmgr - Add ChaCha20 test vectors from RFC7539
We explicitly set the Initial block Counter by prepending it to the nonce in Little Endian. The same test vector is used for both encryption and decryption, ChaCha20 is a cipher XORing a keystream. Signed-off-by: Martin Willi <martin@strongswan.org> Acked-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -2307,6 +2307,21 @@ static const struct alg_test_desc alg_test_descs[] = {
|
||||
}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
.alg = "chacha20",
|
||||
.test = alg_test_skcipher,
|
||||
.suite = {
|
||||
.cipher = {
|
||||
.enc = {
|
||||
.vecs = chacha20_enc_tv_template,
|
||||
.count = CHACHA20_ENC_TEST_VECTORS
|
||||
},
|
||||
.dec = {
|
||||
.vecs = chacha20_enc_tv_template,
|
||||
.count = CHACHA20_ENC_TEST_VECTORS
|
||||
},
|
||||
}
|
||||
}
|
||||
}, {
|
||||
.alg = "cmac(aes)",
|
||||
.test = alg_test_hash,
|
||||
|
Reference in New Issue
Block a user