added 2 3DES-CBC and 3 AES-CBC test vectors
[strongswan.git] / src / libstrongswan / plugins / test_vectors / test_vectors / 3des_cbc.c
1 /*
2 * Copyright (C) 2009 Andreas Steffen
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the Licenseor (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be usefulbut
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 #include <crypto/crypto_tester.h>
17
18 /**
19 * Example 1 from NIST 3DES MMT
20 */
21 crypter_test_vector_t des3_cbc1 = {
22 .alg = ENCR_3DES, .key_size = 24, .len = 8,
23 .key = "\x62\x7f\x46\x0e\x08\x10\x4a\x10"
24 "\x43\xcd\x26\x5d\x58\x40\xea\xf1"
25 "\x31\x3e\xdf\x97\xdf\x2a\x8a\x8c",
26 .iv = "\x8e\x29\xf7\x5e\xa7\x7e\x54\x75",
27 .plain = "\x32\x6a\x49\x4c\xd3\x3f\xe7\x56",
28 .cipher = "\xb2\x2b\x8d\x66\xde\x97\x06\x92"
29 };
30
31 /**
32 * Example 2 from NIST 3DES MMT
33 */
34 crypter_test_vector_t des3_cbc2 = {
35 .alg = ENCR_3DES, .key_size = 24, .len = 16,
36 .key = "\x37\xae\x5e\xbf\x46\xdf\xf2\xdc"
37 "\x07\x54\xb9\x4f\x31\xcb\xb3\x85"
38 "\x5e\x7f\xd3\x6d\xc8\x70\xbf\xae",
39 .iv = "\x3d\x1d\xe3\xcc\x13\x2e\x3b\x65",
40 .plain = "\x84\x40\x1f\x78\xfe\x6c\x10\x87\x6d\x8e\xa2\x30\x94\xea\x53\x09",
41 .cipher = "\x7b\x1f\x7c\x7e\x3b\x1c\x94\x8e\xbd\x04\xa7\x5f\xfb\xa7\xd2\xf5"
42 };
43