diff options
author | Mattias Andrée <maandree@kth.se> | 2024-09-01 18:12:21 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2024-09-01 18:12:21 +0200 |
commit | 85b12e691577b4d4fe09b80b06e91a801dc3dfa9 (patch) | |
tree | 69c64bc9a9fc97826fe8cb2d7ef82f00b1193efc /t/sha_384.c | |
parent | Add support for BLAKE2 (but not tree-hashing) (diff) | |
download | libhashsum-85b12e691577b4d4fe09b80b06e91a801dc3dfa9.tar.gz libhashsum-85b12e691577b4d4fe09b80b06e91a801dc3dfa9.tar.bz2 libhashsum-85b12e691577b4d4fe09b80b06e91a801dc3dfa9.tar.xz |
Move test files into t/
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 't/sha_384.c')
-rw-r--r-- | t/sha_384.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/t/sha_384.c b/t/sha_384.c new file mode 100644 index 0000000..95b4079 --- /dev/null +++ b/t/sha_384.c @@ -0,0 +1,57 @@ +/* See LICENSE file for copyright and license details. */ +#ifdef SUPPORT_SHA2 +# define TEST +# include "../common.h" + + +static struct testcase testcases[] = { + {1, 0, "", + "38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b"}, + {111UL, 8, "\0", + "435770712c611be7293a66dd0dc8d1450dc7ff7337bfe115bf058ef2eb9bed09cee85c26963a5bcc0905dc2df7cc6a76"}, + {112UL, 8, "\0", + "3e0cbf3aee0e3aa70415beae1bd12dd7db821efa446440f12132edffce76f635e53526a111491e75ee8e27b9700eec20"}, + {113UL, 8, "\0", + "6be9af2cf3cd5dd12c8d9399ec2b34e66034fbd699d4e0221d39074172a380656089caafe8f39963f94cc7c0a07e3d21"}, + {122UL, 8, "\0", + "12a72ae4972776b0db7d73d160a15ef0d19645ec96c7f816411ab780c794aa496a22909d941fe671ed3f3caee900bdd5"}, + {1000UL, 8, "\0", + "aae017d4ae5b6346dd60a19d52130fb55194b6327dd40b89c11efc8222292de81e1a23c9b59f9f58b7f6ad463fa108ca"}, + {1000UL, 0, "A", + "7df01148677b7f18617eee3a23104f0eed6bb8c90a6046f715c9445ff43c30d69e9e7082de39c3452fd1d3afd9ba0689"}, + {1005UL, 0, "U", + "1bb8e256da4a0d1e87453528254f223b4cb7e49c4420dbfa766bba4adba44eeca392ff6a9f565bc347158cc970ce44ec"}, + {1000000UL, 8, "\0", + "8a1979f9049b3fff15ea3a43a4cf84c634fd14acad1c333fecb72c588b68868b66a994386dc0cd1687b9ee2e34983b81"}, +#ifdef MASSIVE_TESTS + {0x20000000UL, 0, "Z", + "18aded227cc6b562cc7fb259e8f404549e52914531aa1c5d85167897c779cc4b25d0425fd1590e40bd763ec3f4311c1a"}, + {0x41000000UL, 8, "\0", + "83ab05ca483abe3faa597ad524d31291ae827c5be2b3efcb6391bfed31ccd937b6135e0378c6c7f598857a7c516f207a"}, + {0x6000003EUL, 0, "B", + "cf852304f8d80209351b37ce69ca7dcf34972b4edb7817028ec55ab67ad3bc96eecb8241734258a85d2afce65d4571e2"}, +#endif + {1, 0, "abc", + "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7"}, + {1, 0, "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", + "09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712fcc7c71a557e2db966c3e9fa91746039"}, + {0, 1, "\xff", "9eef0094544d88a6e9ccdf9e31d039c5ca96682293ab1cc3afc6016486190f3d20c89d5a13ebc9d13ff011b411af9186"}, + {0, 1, "\x7f", "9eef0094544d88a6e9ccdf9e31d039c5ca96682293ab1cc3afc6016486190f3d20c89d5a13ebc9d13ff011b411af9186"}, + {0, 1, "\x01", "9eef0094544d88a6e9ccdf9e31d039c5ca96682293ab1cc3afc6016486190f3d20c89d5a13ebc9d13ff011b411af9186"}, + {0, 1, "\xfe", "634aa63038a164ae6c7d48b319f2aca0a107908e548519204c6d72dbeac0fdc3c9246674f98e8fd30221ba986e737d61"}, + {0, 1, "\x7e", "634aa63038a164ae6c7d48b319f2aca0a107908e548519204c6d72dbeac0fdc3c9246674f98e8fd30221ba986e737d61"}, + {0, 1, "\x00", "634aa63038a164ae6c7d48b319f2aca0a107908e548519204c6d72dbeac0fdc3c9246674f98e8fd30221ba986e737d61"} +}; + + +#else +# define TEST_UNSUPPORTED +# include "../common.h" +#endif + + +int +main(void) +{ + TEST_MAIN("SHA-384", SHA_384); +} |