Revert "Merge branch 'upstream' into tizen"
[platform/upstream/nettle.git] / testsuite / cast128-test.c
1 #include "testutils.h"
2 #include "cast128.h"
3
4 void
5 test_main(void)
6 {
7   /* Test vectors from B.1. Single Plaintext-Key-Ciphertext Sets, RFC
8    * 2144 */
9
10   /* 128 bit key */
11   test_cipher(&nettle_cast128,
12               SHEX("01 23 45 67 12 34 56 78"
13                    "23 45 67 89 34 56 78 9A"),
14               SHEX("01 23 45 67 89 AB CD EF"),
15               SHEX("23 8B 4F E5 84 7E 44 B2"));
16   
17   /* 80 bit key */
18   test_cipher(&nettle_cast128,
19               SHEX("01 23 45 67 12 34 56 78 23 45"),
20               SHEX("01 23 45 67 89 AB CD EF"),
21               SHEX("EB 6A 71 1A 2C 02 27 1B"));
22
23   /* 40 bit key */
24   test_cipher(&nettle_cast128,
25               SHEX("01 23 45 67 12"),
26               SHEX("01 23 45 67 89 AB CD EF"),
27               SHEX("7A C8 16 D1 6E 9B 30 2E"));
28 }