aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/testmgr.h
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2009-05-04 07:46:29 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2009-06-02 00:04:40 -0400
commite08ca2da39db22da569dc23578103cdc942fe3ac (patch)
tree2ea4b4d964492400a0930b8d77fbda600877b00d /crypto/testmgr.h
parent7647d6ce2077d9e1c3d72359f6b4492be129cfe8 (diff)
crypto: testmgr - Add ansi_cprng test vectors
Add ANSI X9.31 Continuous Pseudo-Random Number Generator (AES mode), aka 'ansi_cprng' test vectors, taken from Appendix B.2.9 and B.2.10 of the NIST RNGVS document, found here: http://csrc.nist.gov/groups/STM/cavp/documents/rng/RNGVS.pdf Successfully tested against both the cryptodev-2.6 tree and a Red Hat Enterprise Linux 5.4 kernel, via 'modprobe tcrypt mode=150'. The selection of 150 was semi-arbitrary, didn't seem like it should go any place in particular, so I started a new range for rng tests. Signed-off-by: Jarod Wilson <jarod@redhat.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/testmgr.h')
-rw-r--r--crypto/testmgr.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/crypto/testmgr.h b/crypto/testmgr.h
index 13d5a61d0e77..c1c709b57ddb 100644
--- a/crypto/testmgr.h
+++ b/crypto/testmgr.h
@@ -6208,6 +6208,102 @@ static struct aead_testvec aes_ccm_rfc4309_dec_tv_template[] = {
6208 }, 6208 },
6209}; 6209};
6210 6210
6211/*
6212 * ANSI X9.31 Continuous Pseudo-Random Number Generator (AES mode)
6213 * test vectors, taken from Appendix B.2.9 and B.2.10:
6214 * http://csrc.nist.gov/groups/STM/cavp/documents/rng/RNGVS.pdf
6215 * Only AES-128 is supported at this time.
6216 */
6217#define ANSI_CPRNG_AES_TEST_VECTORS 6
6218
6219static struct cprng_testvec ansi_cprng_aes_tv_template[] = {
6220 {
6221 .key = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
6222 "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
6223 .klen = 16,
6224 .dt = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
6225 "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xf9",
6226 .dtlen = 16,
6227 .v = "\x80\x00\x00\x00\x00\x00\x00\x00"
6228 "\x00\x00\x00\x00\x00\x00\x00\x00",
6229 .vlen = 16,
6230 .result = "\x59\x53\x1e\xd1\x3b\xb0\xc0\x55"
6231 "\x84\x79\x66\x85\xc1\x2f\x76\x41",
6232 .rlen = 16,
6233 .loops = 1,
6234 }, {
6235 .key = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
6236 "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
6237 .klen = 16,
6238 .dt = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
6239 "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfa",
6240 .dtlen = 16,
6241 .v = "\xc0\x00\x00\x00\x00\x00\x00\x00"
6242 "\x00\x00\x00\x00\x00\x00\x00\x00",
6243 .vlen = 16,
6244 .result = "\x7c\x22\x2c\xf4\xca\x8f\xa2\x4c"
6245 "\x1c\x9c\xb6\x41\xa9\xf3\x22\x0d",
6246 .rlen = 16,
6247 .loops = 1,
6248 }, {
6249 .key = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
6250 "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
6251 .klen = 16,
6252 .dt = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
6253 "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfb",
6254 .dtlen = 16,
6255 .v = "\xe0\x00\x00\x00\x00\x00\x00\x00"
6256 "\x00\x00\x00\x00\x00\x00\x00\x00",
6257 .vlen = 16,
6258 .result = "\x8a\xaa\x00\x39\x66\x67\x5b\xe5"
6259 "\x29\x14\x28\x81\xa9\x4d\x4e\xc7",
6260 .rlen = 16,
6261 .loops = 1,
6262 }, {
6263 .key = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
6264 "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
6265 .klen = 16,
6266 .dt = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
6267 "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfc",
6268 .dtlen = 16,
6269 .v = "\xf0\x00\x00\x00\x00\x00\x00\x00"
6270 "\x00\x00\x00\x00\x00\x00\x00\x00",
6271 .vlen = 16,
6272 .result = "\x88\xdd\xa4\x56\x30\x24\x23\xe5"
6273 "\xf6\x9d\xa5\x7e\x7b\x95\xc7\x3a",
6274 .rlen = 16,
6275 .loops = 1,
6276 }, {
6277 .key = "\xf3\xb1\x66\x6d\x13\x60\x72\x42"
6278 "\xed\x06\x1c\xab\xb8\xd4\x62\x02",
6279 .klen = 16,
6280 .dt = "\xe6\xb3\xbe\x78\x2a\x23\xfa\x62"
6281 "\xd7\x1d\x4a\xfb\xb0\xe9\x22\xfd",
6282 .dtlen = 16,
6283 .v = "\xf8\x00\x00\x00\x00\x00\x00\x00"
6284 "\x00\x00\x00\x00\x00\x00\x00\x00",
6285 .vlen = 16,
6286 .result = "\x05\x25\x92\x46\x61\x79\xd2\xcb"
6287 "\x78\xc4\x0b\x14\x0a\x5a\x9a\xc8",
6288 .rlen = 16,
6289 .loops = 1,
6290 }, { /* Monte Carlo Test */
6291 .key = "\x9f\x5b\x51\x20\x0b\xf3\x34\xb5"
6292 "\xd8\x2b\xe8\xc3\x72\x55\xc8\x48",
6293 .klen = 16,
6294 .dt = "\x63\x76\xbb\xe5\x29\x02\xba\x3b"
6295 "\x67\xc9\x25\xfa\x70\x1f\x11\xac",
6296 .dtlen = 16,
6297 .v = "\x57\x2c\x8e\x76\x87\x26\x47\x97"
6298 "\x7e\x74\xfb\xdd\xc4\x95\x01\xd1",
6299 .vlen = 16,
6300 .result = "\x48\xe9\xbd\x0d\x06\xee\x18\xfb"
6301 "\xe4\x57\x90\xd5\xc3\xfc\x9b\x73",
6302 .rlen = 16,
6303 .loops = 10000,
6304 },
6305};
6306
6211/* Cast5 test vectors from RFC 2144 */ 6307/* Cast5 test vectors from RFC 2144 */
6212#define CAST5_ENC_TEST_VECTORS 3 6308#define CAST5_ENC_TEST_VECTORS 3
6213#define CAST5_DEC_TEST_VECTORS 3 6309#define CAST5_DEC_TEST_VECTORS 3