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/>.
17 #include <kripto/block/simon32.h>
26 0x19, 0x18, 0x11, 0x10, 0x09, 0x08, 0x01, 0x00
28 const uint8_t pt
[4] = {0x65, 0x65, 0x68, 0x77};
29 const uint8_t ct
[4] = {0xC6, 0x9B, 0xE9, 0xBB};
31 puts("kripto_block_simon32");
34 s
= kripto_block_create(kripto_block_simon32
, 0, k
, 8);
37 kripto_block_encrypt(s
, pt
, t
);
38 for(i
= 0; i
< 4; i
++) if(t
[i
] != ct
[i
])
40 puts("64-bit key encrypt: FAIL");
43 if(i
== 4) puts("64-bit key encrypt: OK");
45 kripto_block_decrypt(s
, ct
, t
);
46 for(i
= 0; i
< 4; i
++) if(t
[i
] != pt
[i
])
48 puts("64-bit key decrypt: FAIL");
51 if(i
== 4) puts("64-bit key decrypt: OK");
53 kripto_block_destroy(s
);