From dbd16766dae9210cb93e3408abc0c53db322e31a Mon Sep 17 00:00:00 2001 From: aqua Date: Mon, 1 Aug 2022 11:22:54 +0300 Subject: Move blake2s selftest to test/ --- com/BLAKE2/test_fns.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 com/BLAKE2/test_fns.c (limited to 'com/BLAKE2/test_fns.c') 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 -#include - -_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)); - -} -- cgit v1.2.1