aboutsummaryrefslogtreecommitdiff
path: root/com/BLAKE2/test_fns.c
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2022-08-01 11:22:54 +0300
committeraqua <aqua@iserlohn-fortress.net>2022-12-28 21:01:46 +0200
commitdbd16766dae9210cb93e3408abc0c53db322e31a (patch)
treefa303790714b90ab4a426d4d1444c81166aecbb4 /com/BLAKE2/test_fns.c
parentBLAKE2s: add Known Answer Tests (diff)
downloadkernel-dbd16766dae9210cb93e3408abc0c53db322e31a.tar.xz
Move blake2s selftest to test/
Diffstat (limited to 'com/BLAKE2/test_fns.c')
-rw-r--r--com/BLAKE2/test_fns.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/com/BLAKE2/test_fns.c b/com/BLAKE2/test_fns.c
deleted file mode 100644
index ca3551a..0000000
--- a/com/BLAKE2/test_fns.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "blake2s.h"
-#include <assert.h>
-#include <stdio.h>
-
-_Static_assert(sizeof(struct BLAKE2s_param) == (8 * sizeof(uint32_t)), "sizeof struct BLAKE2s_param");
-
-int
-main(void)
-{
- assert(rotr_u32(0xdecafade, 16) == 0xfadedeca);
- assert(rotr_u32(0xdecafade, 8) == 0xdedecafa);
-
- union {
- struct BLAKE2s_param block;
- uint32_t data[8];
- } p;
- p.block.outlen = 32;
- p.block.keylen = 0;
- p.block.fanout = 1;
- p.block.depth = 1;
- p.block.leaf_length = 0;
- p.block.node_offset = 0;
- p.block.node_offset_ex = 0;
- p.block.node_depth = 0;
- p.block.inner_length = 0;
- p.block.salt = 0;
- p.block.personalization = 0;
-
- for (int i = 0; i < 8; ++i) printf("%08x ", p.data[i]);
- printf("\n");
-
- assert(p.data[0] == (0x01010000 ^ 32));
-
-}