mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 09:05:39 +01:00
- Added shax_file tests and data files
- Added tests for shax self_test()
This commit is contained in:
parent
3d36082a8d
commit
f3eedce885
BIN
tests/data_files/hash_file_1
Normal file
BIN
tests/data_files/hash_file_1
Normal file
Binary file not shown.
2
tests/data_files/hash_file_2
Normal file
2
tests/data_files/hash_file_2
Normal file
@ -0,0 +1,2 @@
|
||||
'Ος|'D„WΧ<04>~ΫJ>UN*ΟX<06>"πQdδΘiΔ<69>!qα<71>4‰Ί£],0Vλ¶)o›j©~φ<>κΌάmήGwP j$όπ©
³N‰<4E>Η4ά”‹έFβ>5/4Ό΅1ΤΦz|-Ϋ<>
h¶*<12>hαΓAΓ~
|
||||
fΕ‰™·›Μ0ξ<>Α<EFBFBD>Ρ-/ΰb…2“ΈσΘµ
|
BIN
tests/data_files/hash_file_3
Normal file
BIN
tests/data_files/hash_file_3
Normal file
Binary file not shown.
0
tests/data_files/hash_file_4
Normal file
0
tests/data_files/hash_file_4
Normal file
@ -117,3 +117,72 @@ sha512:"49297dd63e5f":"1fcc1e6f6870859d11649f5e5336a9cd16329c029baf04d5a6edf2578
|
||||
|
||||
SHA-512 Test Vector NIST CAVS #8
|
||||
sha512:"990d1ae71a62d7bda9bfdaa1762a68d296eee72a4cd946f287a898fbabc002ea941fd8d4d991030b4d27a637cce501a834bb95eab1b7889a3e784c7968e67cbf552006b206b68f76d9191327524fcc251aeb56af483d10b4e0c6c5e599ee8c0fe4faeca8293844a8547c6a9a90d093f2526873a19ad4a5e776794c68c742fb834793d2dfcb7fea46c63af4b70fd11cb6e41834e72ee40edb067b292a794990c288d5007e73f349fb383af6a756b8301ad6e5e0aa8cd614399bb3a452376b1575afa6bdaeaafc286cb064bb91edef97c632b6c1113d107fa93a0905098a105043c2f05397f702514439a08a9e5ddc196100721d45c8fc17d2ed659376f8a00bd5cb9a0860e26d8a29d8d6aaf52de97e9346033d6db501a35dbbaf97c20b830cd2d18c2532f3a59cc497ee64c0e57d8d060e5069b28d86edf1adcf59144b221ce3ddaef134b3124fbc7dd000240eff0f5f5f41e83cd7f5bb37c9ae21953fe302b0f6e8b68fa91c6ab99265c64b2fd9cd4942be04321bb5d6d71932376c6f2f88e02422ba6a5e2cb765df93fd5dd0728c6abdaf03bce22e0678a544e2c3636f741b6f4447ee58a8fc656b43ef817932176adbfc2e04b2c812c273cd6cbfa4098f0be036a34221fa02643f5ee2e0b38135f2a18ecd2f16ebc45f8eb31b8ab967a1567ee016904188910861ca1fa205c7adaa194b286893ffe2f4fbe0384c2aef72a4522aeafd3ebc71f9db71eeeef86c48394a1c86d5b36c352cc33a0a2c800bc99e62fd65b3a2fd69e0b53996ec13d8ce483ce9319efd9a85acefabdb5342226febb83fd1daf4b24265f50c61c6de74077ef89b6fecf9f29a1f871af1e9f89b2d345cda7499bd45c42fa5d195a1e1a6ba84851889e730da3b2b916e96152ae0c92154b49719841db7e7cc707ba8a5d7b101eb4ac7b629bb327817910fff61580b59aab78182d1a2e33473d05b00b170b29e331870826cfe45af206aa7d0246bbd8566ca7cfb2d3c10bfa1db7dd48dd786036469ce7282093d78b5e1a5b0fc81a54c8ed4ceac1e5305305e78284ac276f5d7862727aff246e17addde50c670028d572cbfc0be2e4f8b2eb28fa68ad7b4c6c2a239c460441bfb5ea049f23b08563b4e47729a59e5986a61a6093dbd54f8c36ebe87edae01f251cb060ad1364ce677d7e8d5a4a4ca966a7241cc360bc2acb280e5f9e9c1b032ad6a180a35e0c5180b9d16d026c865b252098cc1d99ba7375ca31c7702c0d943d5e3dd2f6861fa55bd46d94b67ed3e52eccd8dd06d968e01897d6de97ed3058d91dd":"8e4bc6f8b8c60fe4d68c61d9b159c8693c3151c46749af58da228442d927f23359bd6ccd6c2ec8fa3f00a86cecbfa728e1ad60b821ed22fcd309ba91a4138bc9"
|
||||
|
||||
SHA1 Hash file #1
|
||||
sha1_file:"data_files/hash_file_1":"d21c965b1e768bd7a6aa6869f5f821901d255f9f"
|
||||
|
||||
SHA1 Hash file #2
|
||||
sha1_file:"data_files/hash_file_2":"353f34271f2aef49d23a8913d4a6bd82b2cecdc6"
|
||||
|
||||
SHA1 Hash file #3
|
||||
sha1_file:"data_files/hash_file_3":"93640ed592076328096270c756db2fba9c486b35"
|
||||
|
||||
SHA1 Hash file #4
|
||||
sha1_file:"data_files/hash_file_4":"da39a3ee5e6b4b0d3255bfef95601890afd80709"
|
||||
|
||||
SHA-224 Hash file #1
|
||||
sha224_file:"data_files/hash_file_1":"8606da018870f0c16834a21bc3385704cb1683b9dbab04c5ddb90a48"
|
||||
|
||||
SHA-224 Hash file #2
|
||||
sha224_file:"data_files/hash_file_2":"733b2ab97b6f63f2e29b9a2089756d81e14c93fe4cc9615c0d5e8a03"
|
||||
|
||||
SHA-244 Hash file #3
|
||||
sha224_file:"data_files/hash_file_3":"e1df95867580e2cc2100e9565bf9c2e42c24fe5250c19efe33d1c4fe"
|
||||
|
||||
SHA-224 Hash file #4
|
||||
sha224_file:"data_files/hash_file_4":"d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f"
|
||||
|
||||
SHA-256 Hash file #1
|
||||
sha256_file:"data_files/hash_file_1":"975d0c620d3936886f8a3665e585a3e84aa0501f4225bf53029710242823e391"
|
||||
|
||||
SHA-256 Hash file #2
|
||||
sha256_file:"data_files/hash_file_2":"11fcbf1baa36ca45745f10cc5467aee86f066f80ba2c46806d876bf783022ad2"
|
||||
|
||||
SHA-244 Hash file #3
|
||||
sha256_file:"data_files/hash_file_3":"9ae4b369f9f4f03b86505b46a5469542e00aaff7cf7417a71af6d6d0aba3b70c"
|
||||
|
||||
SHA-256 Hash file #4
|
||||
sha256_file:"data_files/hash_file_4":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
|
||||
SHA-384 Hash file #1
|
||||
sha384_file:"data_files/hash_file_1":"e0a3e6259d6378001b54ef82f5dd087009c5fad86d8db226a9fe1d14ecbe33a6fc916e3a4b16f5f286424de15d5a8e0e"
|
||||
|
||||
SHA-384 Hash file #2
|
||||
sha384_file:"data_files/hash_file_2":"eff727afc8495c92e2f370f97a317f93c3350324b0646b0f0e264708b3c97d3d332d3c5390e1e47130f5c92f1ef4b9cf"
|
||||
|
||||
SHA-244 Hash file #3
|
||||
sha384_file:"data_files/hash_file_3":"6fc10ebda96a1ccf61777cac72f6034f92533d42052a4bf9f9d929c672973c71e5aeb1213268043c21527ac0f7f349c4"
|
||||
|
||||
SHA-384 Hash file #4
|
||||
sha384_file:"data_files/hash_file_4":"38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b"
|
||||
|
||||
SHA-512 Hash file #1
|
||||
sha512_file:"data_files/hash_file_1":"d8207a2e1ff2b424f2c4163fe1b723c9bd42e464061eb411e8df730bcd24a7ab3956a6f3ff044a52eb2d262f9e4ca6b524092b544ab78f14d6f9c4cc8ddf335a"
|
||||
|
||||
SHA-512 Hash file #2
|
||||
sha512_file:"data_files/hash_file_2":"ecbb7f0ed8a702b49f16ad3088bcc06ea93451912a7187db15f64d93517b09630b039293aed418d4a00695777b758b1f381548c2fd7b92ce5ed996b32c8734e7"
|
||||
|
||||
SHA-244 Hash file #3
|
||||
sha512_file:"data_files/hash_file_3":"7ccc9b2da71ffde9966c3ce44d7f20945fccf33b1fade4da152b021f1afcc7293382944aa6c09eac67af25f22026758e2bf6bed86ae2a43592677ee50f8eea41"
|
||||
|
||||
SHA-512 Hash file #4
|
||||
sha512_file:"data_files/hash_file_4":"cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"
|
||||
|
||||
SHA-1 Selftest
|
||||
sha1_selftest:
|
||||
|
||||
SHA-2 Selftest
|
||||
sha2_selftest:
|
||||
|
||||
SHA-4 Selftest
|
||||
sha4_selftest:
|
||||
|
@ -103,3 +103,104 @@ sha512:hex_src_string:hex_hash_string
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, {hex_hash_string} ) == 0 );
|
||||
}
|
||||
END_CASE
|
||||
|
||||
BEGIN_CASE
|
||||
sha1_file:filename:hex_hash_string
|
||||
{
|
||||
unsigned char hash_str[41];
|
||||
unsigned char output[21];
|
||||
|
||||
memset(hash_str, 0x00, 41);
|
||||
memset(output, 0x00, 21);
|
||||
|
||||
sha1_file( {filename}, output);
|
||||
hexify( hash_str, output, 20 );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, {hex_hash_string} ) == 0 );
|
||||
}
|
||||
END_CASE
|
||||
|
||||
BEGIN_CASE
|
||||
sha224_file:filename:hex_hash_string
|
||||
{
|
||||
unsigned char hash_str[57];
|
||||
unsigned char output[29];
|
||||
|
||||
memset(hash_str, 0x00, 57);
|
||||
memset(output, 0x00, 29);
|
||||
|
||||
sha2_file( {filename}, output, 1);
|
||||
hexify( hash_str, output, 28 );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, {hex_hash_string} ) == 0 );
|
||||
}
|
||||
END_CASE
|
||||
|
||||
BEGIN_CASE
|
||||
sha256_file:filename:hex_hash_string
|
||||
{
|
||||
unsigned char hash_str[65];
|
||||
unsigned char output[33];
|
||||
|
||||
memset(hash_str, 0x00, 65);
|
||||
memset(output, 0x00, 33);
|
||||
|
||||
sha2_file( {filename}, output, 0);
|
||||
hexify( hash_str, output, 32 );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, {hex_hash_string} ) == 0 );
|
||||
}
|
||||
END_CASE
|
||||
|
||||
BEGIN_CASE
|
||||
sha384_file:filename:hex_hash_string
|
||||
{
|
||||
unsigned char hash_str[97];
|
||||
unsigned char output[49];
|
||||
|
||||
memset(hash_str, 0x00, 97);
|
||||
memset(output, 0x00, 49);
|
||||
|
||||
sha4_file( {filename}, output, 1);
|
||||
hexify( hash_str, output, 48 );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, {hex_hash_string} ) == 0 );
|
||||
}
|
||||
END_CASE
|
||||
|
||||
BEGIN_CASE
|
||||
sha512_file:filename:hex_hash_string
|
||||
{
|
||||
unsigned char hash_str[129];
|
||||
unsigned char output[65];
|
||||
|
||||
memset(hash_str, 0x00, 129);
|
||||
memset(output, 0x00, 65);
|
||||
|
||||
sha4_file( {filename}, output, 0);
|
||||
hexify( hash_str, output, 64 );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, {hex_hash_string} ) == 0 );
|
||||
}
|
||||
END_CASE
|
||||
|
||||
BEGIN_CASE
|
||||
sha1_selftest:
|
||||
{
|
||||
TEST_ASSERT( sha1_self_test( 0 ) == 0 );
|
||||
}
|
||||
END_CASE
|
||||
|
||||
BEGIN_CASE
|
||||
sha2_selftest:
|
||||
{
|
||||
TEST_ASSERT( sha2_self_test( 0 ) == 0 );
|
||||
}
|
||||
END_CASE
|
||||
|
||||
BEGIN_CASE
|
||||
sha4_selftest:
|
||||
{
|
||||
TEST_ASSERT( sha4_self_test( 0 ) == 0 );
|
||||
}
|
||||
END_CASE
|
||||
|
Loading…
Reference in New Issue
Block a user