Skip to content

Commit

Permalink
crypto: testmgr - Add self-tests for rfc4309(ccm(aes))
Browse files Browse the repository at this point in the history
Add an array of encryption and decryption + verification self-tests
for rfc4309(ccm(aes)).

Test vectors all come from sample FIPS CAVS files provided to
Red Hat by a testing lab. Unfortunately, all the published sample
vectors in RFC 3610 and NIST Special Publication 800-38C contain nonce
lengths that the kernel's rfc4309 implementation doesn't support, so
while using some public domain vectors would have been preferred, its
not possible at this time.

Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Jarod Wilson authored and Herbert Xu committed Jun 2, 2009
1 parent e44a1b4 commit 5d66732
Show file tree
Hide file tree
Showing 3 changed files with 389 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crypto/tcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,10 @@ static void do_test(int m)
tcrypt_test("zlib");
break;

case 45:
tcrypt_test("rfc4309(ccm(aes))");
break;

case 100:
tcrypt_test("hmac(md5)");
break;
Expand Down
15 changes: 15 additions & 0 deletions crypto/testmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1878,6 +1878,21 @@ static const struct alg_test_desc alg_test_descs[] = {
}
}
}
}, {
.alg = "rfc4309(ccm(aes))",
.test = alg_test_aead,
.suite = {
.aead = {
.enc = {
.vecs = aes_ccm_rfc4309_enc_tv_template,
.count = AES_CCM_4309_ENC_TEST_VECTORS
},
.dec = {
.vecs = aes_ccm_rfc4309_dec_tv_template,
.count = AES_CCM_4309_DEC_TEST_VECTORS
}
}
}
}, {
.alg = "rmd128",
.test = alg_test_hash,
Expand Down
Loading

0 comments on commit 5d66732

Please sign in to comment.