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/>.
19 #include <kripto/mac.h>
20 #include <kripto/mac/xcbc.h>
21 #include <kripto/block/rijndael128.h>
23 static const uint8_t key
[16] =
25 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
26 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
29 static const uint8_t msg
[34] =
31 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
32 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
33 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
34 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
38 static const uint8_t tag
[16] =
40 0xBE, 0xCB, 0xB3, 0xBC, 0xCD, 0xB5, 0x18, 0xA3,
41 0x06, 0x77, 0xD5, 0x48, 0x1F, 0xB6, 0xB4, 0xD8
46 kripto_mac_desc
*desc
;
49 desc
= kripto_mac_xcbc(kripto_block_rijndael128
);
59 if(memcmp(tag
, t
, 16)) puts("xcbc rijndael128: FAIL");
60 else puts("xcbc rijndael128: OK");