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/rc5.h>
26 0x91, 0x5F, 0x46, 0x19, 0xBE, 0x41, 0xB2, 0x51,
27 0x63, 0x55, 0xA5, 0x01, 0x10, 0xA9, 0xCE, 0x91
31 0x21, 0xA5, 0xDB, 0xEE, 0x15, 0x4B, 0x8F, 0x6D
35 0xF7, 0xC0, 0x13, 0xAC, 0x5B, 0x2B, 0x89, 0x52
38 puts("kripto_block_rc5");
41 s
= kripto_block_create(kripto_block_rc5
, 0, k
, 16);
44 kripto_block_encrypt(s
, pt
, t
);
45 if(memcmp(t
, ct
, 8)) puts("128-bit key encrypt: FAIL");
46 else puts("128-bit key encrypt: OK");
48 kripto_block_decrypt(s
, ct
, t
);
49 if(memcmp(t
, pt
, 8)) puts("128-bit key decrypt: FAIL");
50 else puts("128-bit key decrypt: OK");
52 kripto_block_destroy(s
);