2 * Written in 2013 by Gregor Pintar <grpintar@gmail.com>
4 * To the extent possible under law, the author(s) have dedicated
5 * all copyright and related and neighboring rights to this software
6 * to the public domain worldwide.
8 * This software is distributed without any warranty.
10 * You should have received a copy of the CC0 Public Domain Dedication.
11 * If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
18 #include <kripto/block.h>
19 #include <kripto/block/khazad.h>
27 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
28 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
32 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
36 0x49, 0xA4, 0xCE, 0x32, 0xAC, 0x19, 0x0E, 0x3F
39 puts("kripto_block_khazad");
42 s
= kripto_block_create(kripto_block_khazad
, 0, k
, 16);
45 kripto_block_encrypt(s
, pt
, t
);
46 if(memcmp(t
, ct
, 8)) puts("128-bit key encrypt: FAIL");
47 else puts("128-bit key encrypt: OK");
49 kripto_block_decrypt(s
, ct
, t
);
50 if(memcmp(t
, pt
, 8)) puts("128-bit key decrypt: FAIL");
51 else puts("128-bit key decrypt: OK");
53 kripto_block_destroy(s
);