added MD5 test vectors
[strongswan.git] / src / libstrongswan / plugins / test_vectors / test_vectors / blowfish.c
1 /*
2 * Copyright (C) 2009 Martin Willi
3 * Copyright (C) 2009 Andreas Steffen
4 * Copyright (C) JuanJo Ciarlante <jjo-ipsec@mendoza.gov.ar>
5 * Hochschule fuer Technik Rapperswil
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the Licenseor (at your
10 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 *
12 * This program is distributed in the hope that it will be usefulbut
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
16 */
17
18 #include <crypto/crypto_tester.h>
19
20 /**
21 * Test vector by Eric Young
22 */
23 crypter_test_vector_t blowfish1 = {
24 .alg = ENCR_BLOWFISH, .key_size = 16, .len = 32,
25 .key = "\x01\x23\x45\x67\x89\xAB\xCD\xEF\xF0\xE1\xD2\xC3\xB4\xA5\x96\x87",
26 .iv = "\xFE\xDC\xBA\x98\x76\x54\x32\x10",
27 .plain = "7654321 Now is the time for \0\0\0\0",
28 .cipher = "\x6B\x77\xB4\xD6\x30\x06\xDE\xE6\x05\xB1\x56\xE2\x74\x03\x97\x93"
29 "\x58\xDE\xB9\xE7\x15\x46\x16\xD9\x59\xF1\x65\x2B\xD5\xFF\x92\xCC"
30 };
31
32 /**
33 * Test vector by Chilkat Software
34 * (www.chilkatsoft.com/p/php_blowfish.asp)
35 */
36 crypter_test_vector_t blowfish2 = {
37 .alg = ENCR_BLOWFISH, .key_size = 32, .len = 48,
38 .key = "\x31\x32\x33\x34\x35\x36\x37\x38\x39\x30\x31\x32\x33\x34\x35\x36"
39 "\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50",
40 .iv = "\x31\x32\x33\x34\x35\x36\x37\x38",
41 .plain = "The quick brown fox jumped over the lazy dog\0\0\0\0",
42 .cipher = "\x27\x68\x55\xca\x6c\x0d\x60\xf7\xd9\x70\x82\x10\x44\x0c\x10\x72"
43 "\xe0\x5d\x07\x8e\x73\x3b\x34\xb4\x19\x8d\x60\x9d\xc2\xfc\xc2\xf0"
44 "\xc3\x09\x26\xcd\xef\x3b\x6d\x52\xba\xf6\xe3\x45\xaa\x03\xf8\x3e"
45 };
46