diff options
author | raveendra padasalagi <raveendra.padasalagi@broadcom.com> | 2016-06-17 01:00:36 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-06-20 07:25:02 -0400 |
commit | 79cc6ab8947bd238b64afddc56ed84ee65f012ef (patch) | |
tree | 3b361a923dee4a3b92043f78295f63f80fb2bc4f /crypto/testmgr.h | |
parent | 53964b9ee63b7075931b8df85307c449da564b50 (diff) |
crypto: sha3 - Add SHA-3 Test's in tcrypt
Added support for SHA-3 algorithm test's
in tcrypt module and related test vectors.
Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/testmgr.h')
-rw-r--r-- | crypto/testmgr.h | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/crypto/testmgr.h b/crypto/testmgr.h index 487ec880e889..b70e3c92bedd 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h | |||
@@ -376,6 +376,131 @@ static struct hash_testvec md4_tv_template [] = { | |||
376 | }, | 376 | }, |
377 | }; | 377 | }; |
378 | 378 | ||
379 | #define SHA3_224_TEST_VECTORS 3 | ||
380 | static struct hash_testvec sha3_224_tv_template[] = { | ||
381 | { | ||
382 | .plaintext = "", | ||
383 | .digest = "\x6b\x4e\x03\x42\x36\x67\xdb\xb7" | ||
384 | "\x3b\x6e\x15\x45\x4f\x0e\xb1\xab" | ||
385 | "\xd4\x59\x7f\x9a\x1b\x07\x8e\x3f" | ||
386 | "\x5b\x5a\x6b\xc7", | ||
387 | }, { | ||
388 | .plaintext = "a", | ||
389 | .psize = 1, | ||
390 | .digest = "\x9e\x86\xff\x69\x55\x7c\xa9\x5f" | ||
391 | "\x40\x5f\x08\x12\x69\x68\x5b\x38" | ||
392 | "\xe3\xa8\x19\xb3\x09\xee\x94\x2f" | ||
393 | "\x48\x2b\x6a\x8b", | ||
394 | }, { | ||
395 | .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl" | ||
396 | "jklmklmnlmnomnopnopq", | ||
397 | .psize = 56, | ||
398 | .digest = "\x8a\x24\x10\x8b\x15\x4a\xda\x21" | ||
399 | "\xc9\xfd\x55\x74\x49\x44\x79\xba" | ||
400 | "\x5c\x7e\x7a\xb7\x6e\xf2\x64\xea" | ||
401 | "\xd0\xfc\xce\x33", | ||
402 | }, | ||
403 | }; | ||
404 | |||
405 | #define SHA3_256_TEST_VECTORS 3 | ||
406 | static struct hash_testvec sha3_256_tv_template[] = { | ||
407 | { | ||
408 | .plaintext = "", | ||
409 | .digest = "\xa7\xff\xc6\xf8\xbf\x1e\xd7\x66" | ||
410 | "\x51\xc1\x47\x56\xa0\x61\xd6\x62" | ||
411 | "\xf5\x80\xff\x4d\xe4\x3b\x49\xfa" | ||
412 | "\x82\xd8\x0a\x4b\x80\xf8\x43\x4a", | ||
413 | }, { | ||
414 | .plaintext = "a", | ||
415 | .psize = 1, | ||
416 | .digest = "\x80\x08\x4b\xf2\xfb\xa0\x24\x75" | ||
417 | "\x72\x6f\xeb\x2c\xab\x2d\x82\x15" | ||
418 | "\xea\xb1\x4b\xc6\xbd\xd8\xbf\xb2" | ||
419 | "\xc8\x15\x12\x57\x03\x2e\xcd\x8b", | ||
420 | }, { | ||
421 | .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl" | ||
422 | "jklmklmnlmnomnopnopq", | ||
423 | .psize = 56, | ||
424 | .digest = "\x41\xc0\xdb\xa2\xa9\xd6\x24\x08" | ||
425 | "\x49\x10\x03\x76\xa8\x23\x5e\x2c" | ||
426 | "\x82\xe1\xb9\x99\x8a\x99\x9e\x21" | ||
427 | "\xdb\x32\xdd\x97\x49\x6d\x33\x76", | ||
428 | }, | ||
429 | }; | ||
430 | |||
431 | |||
432 | #define SHA3_384_TEST_VECTORS 3 | ||
433 | static struct hash_testvec sha3_384_tv_template[] = { | ||
434 | { | ||
435 | .plaintext = "", | ||
436 | .digest = "\x0c\x63\xa7\x5b\x84\x5e\x4f\x7d" | ||
437 | "\x01\x10\x7d\x85\x2e\x4c\x24\x85" | ||
438 | "\xc5\x1a\x50\xaa\xaa\x94\xfc\x61" | ||
439 | "\x99\x5e\x71\xbb\xee\x98\x3a\x2a" | ||
440 | "\xc3\x71\x38\x31\x26\x4a\xdb\x47" | ||
441 | "\xfb\x6b\xd1\xe0\x58\xd5\xf0\x04", | ||
442 | }, { | ||
443 | .plaintext = "a", | ||
444 | .psize = 1, | ||
445 | .digest = "\x18\x15\xf7\x74\xf3\x20\x49\x1b" | ||
446 | "\x48\x56\x9e\xfe\xc7\x94\xd2\x49" | ||
447 | "\xee\xb5\x9a\xae\x46\xd2\x2b\xf7" | ||
448 | "\x7d\xaf\xe2\x5c\x5e\xdc\x28\xd7" | ||
449 | "\xea\x44\xf9\x3e\xe1\x23\x4a\xa8" | ||
450 | "\x8f\x61\xc9\x19\x12\xa4\xcc\xd9", | ||
451 | }, { | ||
452 | .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl" | ||
453 | "jklmklmnlmnomnopnopq", | ||
454 | .psize = 56, | ||
455 | .digest = "\x99\x1c\x66\x57\x55\xeb\x3a\x4b" | ||
456 | "\x6b\xbd\xfb\x75\xc7\x8a\x49\x2e" | ||
457 | "\x8c\x56\xa2\x2c\x5c\x4d\x7e\x42" | ||
458 | "\x9b\xfd\xbc\x32\xb9\xd4\xad\x5a" | ||
459 | "\xa0\x4a\x1f\x07\x6e\x62\xfe\xa1" | ||
460 | "\x9e\xef\x51\xac\xd0\x65\x7c\x22", | ||
461 | }, | ||
462 | }; | ||
463 | |||
464 | |||
465 | #define SHA3_512_TEST_VECTORS 3 | ||
466 | static struct hash_testvec sha3_512_tv_template[] = { | ||
467 | { | ||
468 | .plaintext = "", | ||
469 | .digest = "\xa6\x9f\x73\xcc\xa2\x3a\x9a\xc5" | ||
470 | "\xc8\xb5\x67\xdc\x18\x5a\x75\x6e" | ||
471 | "\x97\xc9\x82\x16\x4f\xe2\x58\x59" | ||
472 | "\xe0\xd1\xdc\xc1\x47\x5c\x80\xa6" | ||
473 | "\x15\xb2\x12\x3a\xf1\xf5\xf9\x4c" | ||
474 | "\x11\xe3\xe9\x40\x2c\x3a\xc5\x58" | ||
475 | "\xf5\x00\x19\x9d\x95\xb6\xd3\xe3" | ||
476 | "\x01\x75\x85\x86\x28\x1d\xcd\x26", | ||
477 | }, { | ||
478 | .plaintext = "a", | ||
479 | .psize = 1, | ||
480 | .digest = "\x69\x7f\x2d\x85\x61\x72\xcb\x83" | ||
481 | "\x09\xd6\xb8\xb9\x7d\xac\x4d\xe3" | ||
482 | "\x44\xb5\x49\xd4\xde\xe6\x1e\xdf" | ||
483 | "\xb4\x96\x2d\x86\x98\xb7\xfa\x80" | ||
484 | "\x3f\x4f\x93\xff\x24\x39\x35\x86" | ||
485 | "\xe2\x8b\x5b\x95\x7a\xc3\xd1\xd3" | ||
486 | "\x69\x42\x0c\xe5\x33\x32\x71\x2f" | ||
487 | "\x99\x7b\xd3\x36\xd0\x9a\xb0\x2a", | ||
488 | }, { | ||
489 | .plaintext = "abcdbcdecdefdefgefghfghighijhijkijkl" | ||
490 | "jklmklmnlmnomnopnopq", | ||
491 | .psize = 56, | ||
492 | .digest = "\x04\xa3\x71\xe8\x4e\xcf\xb5\xb8" | ||
493 | "\xb7\x7c\xb4\x86\x10\xfc\xa8\x18" | ||
494 | "\x2d\xd4\x57\xce\x6f\x32\x6a\x0f" | ||
495 | "\xd3\xd7\xec\x2f\x1e\x91\x63\x6d" | ||
496 | "\xee\x69\x1f\xbe\x0c\x98\x53\x02" | ||
497 | "\xba\x1b\x0d\x8d\xc7\x8c\x08\x63" | ||
498 | "\x46\xb5\x33\xb4\x9c\x03\x0d\x99" | ||
499 | "\xa2\x7d\xaf\x11\x39\xd6\xe7\x5e", | ||
500 | }, | ||
501 | }; | ||
502 | |||
503 | |||
379 | /* | 504 | /* |
380 | * MD5 test vectors from RFC1321 | 505 | * MD5 test vectors from RFC1321 |
381 | */ | 506 | */ |