Skip to content

Commit 69435b9

Browse files
adrianhobanherbertx
authored andcommitted
crypto: rfc4106 - Extending the RC4106 AES-GCM test vectors
Updated RFC4106 AES-GCM testing. Some test vectors were taken from http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/ gcm/gcm-test-vectors.tar.gz Signed-off-by: Adrian Hoban <[email protected]> Signed-off-by: Tadeusz Struk <[email protected]> Signed-off-by: Gabriele Paoloni <[email protected]> Signed-off-by: Aidan O'Mahony <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 0bd82f5 commit 69435b9

File tree

3 files changed

+396
-0
lines changed

3 files changed

+396
-0
lines changed

crypto/tcrypt.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
* Copyright (c) 2002 Jean-Francois Dive <[email protected]>
99
* Copyright (c) 2007 Nokia Siemens Networks
1010
*
11+
* Updated RFC4106 AES-GCM testing.
12+
* Authors: Aidan O'Mahony ([email protected])
13+
* Adrian Hoban <[email protected]>
14+
* Gabriele Paoloni <[email protected]>
15+
* Tadeusz Struk ([email protected])
16+
* Copyright (c) 2010, Intel Corporation.
17+
*
1118
* This program is free software; you can redistribute it and/or modify it
1219
* under the terms of the GNU General Public License as published by the Free
1320
* Software Foundation; either version 2 of the License, or (at your option)
@@ -980,6 +987,10 @@ static int do_test(int m)
980987
ret += tcrypt_test("ansi_cprng");
981988
break;
982989

990+
case 151:
991+
ret += tcrypt_test("rfc4106(gcm(aes))");
992+
break;
993+
983994
case 200:
984995
test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
985996
speed_template_16_24_32);

crypto/testmgr.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
* Copyright (c) 2007 Nokia Siemens Networks
77
* Copyright (c) 2008 Herbert Xu <[email protected]>
88
*
9+
* Updated RFC4106 AES-GCM testing.
10+
* Authors: Aidan O'Mahony ([email protected])
11+
* Adrian Hoban <[email protected]>
12+
* Gabriele Paoloni <[email protected]>
13+
* Tadeusz Struk ([email protected])
14+
* Copyright (c) 2010, Intel Corporation.
15+
*
916
* This program is free software; you can redistribute it and/or modify it
1017
* under the terms of the GNU General Public License as published by the Free
1118
* Software Foundation; either version 2 of the License, or (at your option)
@@ -2242,6 +2249,23 @@ static const struct alg_test_desc alg_test_descs[] = {
22422249
}
22432250
}
22442251
}, {
2252+
.alg = "rfc4106(gcm(aes))",
2253+
.test = alg_test_aead,
2254+
.suite = {
2255+
.aead = {
2256+
.enc = {
2257+
.vecs = aes_gcm_rfc4106_enc_tv_template,
2258+
.count = AES_GCM_4106_ENC_TEST_VECTORS
2259+
},
2260+
.dec = {
2261+
.vecs = aes_gcm_rfc4106_dec_tv_template,
2262+
.count = AES_GCM_4106_DEC_TEST_VECTORS
2263+
}
2264+
}
2265+
}
2266+
}, {
2267+
2268+
22452269
.alg = "rfc4309(ccm(aes))",
22462270
.test = alg_test_aead,
22472271
.fips_allowed = 1,

0 commit comments

Comments
 (0)