aboutsummaryrefslogtreecommitdiffstats
path: root/sha_512_256.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-08-23 23:40:36 +0200
committerMattias Andrée <maandree@kth.se>2024-08-23 23:40:36 +0200
commit4dc7dcef3136b49ff6cb34f28508965433863be8 (patch)
tree2909c34a9351f3567bccec4741ecd53b98327d31 /sha_512_256.c
parentFixes + add SHA0 and SHA1 using libsha1 (diff)
downloadlibhashsum-4dc7dcef3136b49ff6cb34f28508965433863be8.tar.gz
libhashsum-4dc7dcef3136b49ff6cb34f28508965433863be8.tar.bz2
libhashsum-4dc7dcef3136b49ff6cb34f28508965433863be8.tar.xz
Fixes + add SHA2 support via libsha2
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'sha_512_256.c')
-rw-r--r--sha_512_256.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sha_512_256.c b/sha_512_256.c
new file mode 100644
index 0000000..1f41597
--- /dev/null
+++ b/sha_512_256.c
@@ -0,0 +1,19 @@
+/* See LICENSE file for copyright and license details. */
+#define TEST
+#include "common.h"
+
+
+static struct testcase testcases[] = {
+ {1, 0, "", "c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a"},
+ {1000UL, 0, "A", "6ad592c8991fa0fc0fc78b6c2e73f3b55db74afeb1027a5aeacb787fb531e64a"},
+ {1, 0, "abc", "53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23"},
+ {1, 0, "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",
+ "3928e184fb8690f840da3988121d31be65cb9d3ef83ee6146feac861e19b563a"}
+};
+
+
+int
+main(void)
+{
+ TEST_MAIN("SHA-512/256", SHA_512_256);
+}