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/3way.h>
26 0xD2, 0xF0, 0x5B, 0x5E, 0xD6, 0x14,
27 0x41, 0x38, 0xCA, 0xB9, 0x20, 0xCD
29 const uint8_t pt
[12] =
31 0x40, 0x59, 0xC7, 0x6E, 0x83, 0xAE,
32 0x9D, 0xC4, 0xAD, 0x21, 0xEC, 0xF7
34 const uint8_t ct
[12] =
36 0x47, 0x8E, 0xA8, 0x71, 0x6B, 0x13,
37 0xF1, 0x7C, 0x15, 0xB1, 0x55, 0xED
40 puts("kripto_block_3way");
43 s
= kripto_block_create(kripto_block_3way
, 0, k
, 12);
46 kripto_block_encrypt(s
, pt
, t
);
47 if(memcmp(t
, ct
, 12)) puts("96-bit key encrypt: FAIL");
48 else puts("96-bit key encrypt: OK");
50 kripto_block_decrypt(s
, ct
, t
);
51 if(memcmp(t
, pt
, 12)) puts("96-bit key decrypt: FAIL");
52 else puts("96-bit key decrypt: OK");
54 kripto_block_destroy(s
);