Sun, 23 Jun 2013 02:34:22 -0500
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
| 15105 | 1 | #include <glib.h> |
| 2 | #include <check.h> | |
| 3 | #include <stdlib.h> | |
| 4 | #include <string.h> | |
| 5 | ||
| 6 | #undef HAVE_DBUS | |
| 7 | ||
|
15950
0f01bb61c5d3
Fix compiler warnings and errors in tests resulting from using DEBUG_CFLAGS
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
8 | #include "tests.h" |
|
0f01bb61c5d3
Fix compiler warnings and errors in tests resulting from using DEBUG_CFLAGS
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
9 | |
| 15105 | 10 | #include "../cipher.h" |
| 11 | ||
| 12 | /****************************************************************************** | |
| 13 | * MD4 Tests | |
| 14 | *****************************************************************************/ | |
| 15 | #define MD4_TEST(data, digest) { \ | |
| 15884 | 16 | PurpleCipher *cipher = NULL; \ |
| 17 | PurpleCipherContext *context = NULL; \ | |
| 15105 | 18 | gchar cdigest[33]; \ |
| 19 | gboolean ret = FALSE; \ | |
| 20 | \ | |
| 15884 | 21 | cipher = purple_ciphers_find_cipher("md4"); \ |
| 22 | context = purple_cipher_context_new(cipher, NULL); \ | |
| 23 | purple_cipher_context_append(context, (guchar *)(data), strlen((data))); \ | |
| 15105 | 24 | \ |
|
34221
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
25 | ret = purple_cipher_context_digest_to_str(context, cdigest, sizeof(cdigest)); \ |
| 15105 | 26 | \ |
| 27 | fail_unless(ret == TRUE, NULL); \ | |
| 28 | \ | |
| 29 | fail_unless(strcmp((digest), cdigest) == 0, NULL); \ | |
| 30 | \ | |
| 15884 | 31 | purple_cipher_context_destroy(context); \ |
| 15105 | 32 | } |
| 33 | ||
| 34 | START_TEST(test_md4_empty_string) { | |
| 35 | MD4_TEST("", "31d6cfe0d16ae931b73c59d7e0c089c0"); | |
| 36 | } | |
| 37 | END_TEST | |
| 38 | ||
| 39 | START_TEST(test_md4_a) { | |
| 40 | MD4_TEST("a", "bde52cb31de33e46245e05fbdbd6fb24"); | |
| 41 | } | |
| 42 | END_TEST | |
| 43 | ||
| 44 | START_TEST(test_md4_abc) { | |
| 45 | MD4_TEST("abc", "a448017aaf21d8525fc10ae87aa6729d"); | |
| 46 | } | |
| 47 | END_TEST | |
| 48 | ||
| 49 | START_TEST(test_md4_message_digest) { | |
| 50 | MD4_TEST("message digest", "d9130a8164549fe818874806e1c7014b"); | |
| 51 | } | |
| 52 | END_TEST | |
| 53 | ||
| 54 | START_TEST(test_md4_a_to_z) { | |
| 55 | MD4_TEST("abcdefghijklmnopqrstuvwxyz", | |
| 56 | "d79e1c308aa5bbcdeea8ed63df412da9"); | |
| 57 | } | |
| 58 | END_TEST | |
| 59 | ||
| 60 | START_TEST(test_md4_A_to_Z_a_to_z_0_to_9) { | |
| 61 | MD4_TEST("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", | |
| 62 | "043f8582f241db351ce627e153e7f0e4"); | |
| 63 | } | |
| 64 | END_TEST | |
| 65 | ||
| 66 | START_TEST(test_md4_1_to_0_8_times) { | |
| 67 | MD4_TEST("123456789012345678901234567890123456789012345678901234567890" | |
| 68 | "12345678901234567890", | |
| 69 | "e33b4ddc9c38f2199c3e7b164fcc0536"); | |
| 70 | } | |
| 71 | END_TEST | |
| 72 | ||
| 73 | ||
| 74 | /****************************************************************************** | |
| 75 | * MD5 Tests | |
| 76 | *****************************************************************************/ | |
| 77 | #define MD5_TEST(data, digest) { \ | |
| 15884 | 78 | PurpleCipher *cipher = NULL; \ |
| 79 | PurpleCipherContext *context = NULL; \ | |
| 15105 | 80 | gchar cdigest[33]; \ |
| 81 | gboolean ret = FALSE; \ | |
| 82 | \ | |
| 15884 | 83 | cipher = purple_ciphers_find_cipher("md5"); \ |
| 84 | context = purple_cipher_context_new(cipher, NULL); \ | |
| 85 | purple_cipher_context_append(context, (guchar *)(data), strlen((data))); \ | |
| 15105 | 86 | \ |
|
34221
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
87 | ret = purple_cipher_context_digest_to_str(context, cdigest, sizeof(cdigest)); \ |
| 15105 | 88 | \ |
| 89 | fail_unless(ret == TRUE, NULL); \ | |
| 90 | \ | |
| 91 | fail_unless(strcmp((digest), cdigest) == 0, NULL); \ | |
| 92 | \ | |
| 15884 | 93 | purple_cipher_context_destroy(context); \ |
| 15105 | 94 | } |
| 95 | ||
| 96 | START_TEST(test_md5_empty_string) { | |
| 97 | MD5_TEST("", "d41d8cd98f00b204e9800998ecf8427e"); | |
| 98 | } | |
| 99 | END_TEST | |
| 100 | ||
| 101 | START_TEST(test_md5_a) { | |
| 102 | MD5_TEST("a", "0cc175b9c0f1b6a831c399e269772661"); | |
| 103 | } | |
| 104 | END_TEST | |
| 105 | ||
| 106 | START_TEST(test_md5_abc) { | |
| 107 | MD5_TEST("abc", "900150983cd24fb0d6963f7d28e17f72"); | |
| 108 | } | |
| 109 | END_TEST | |
| 110 | ||
| 111 | START_TEST(test_md5_message_digest) { | |
| 112 | MD5_TEST("message digest", "f96b697d7cb7938d525a2f31aaf161d0"); | |
| 113 | } | |
| 114 | END_TEST | |
| 115 | ||
| 116 | START_TEST(test_md5_a_to_z) { | |
| 117 | MD5_TEST("abcdefghijklmnopqrstuvwxyz", | |
| 118 | "c3fcd3d76192e4007dfb496cca67e13b"); | |
| 119 | } | |
| 120 | END_TEST | |
| 121 | ||
| 122 | START_TEST(test_md5_A_to_Z_a_to_z_0_to_9) { | |
| 123 | MD5_TEST("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", | |
| 124 | "d174ab98d277d9f5a5611c2c9f419d9f"); | |
| 125 | } | |
| 126 | END_TEST | |
| 127 | ||
| 128 | START_TEST(test_md5_1_to_0_8_times) { | |
| 129 | MD5_TEST("123456789012345678901234567890123456789012345678901234567890" | |
| 130 | "12345678901234567890", | |
| 131 | "57edf4a22be3c955ac49da2e2107b67a"); | |
| 132 | } | |
| 133 | END_TEST | |
| 134 | ||
| 135 | /****************************************************************************** | |
| 136 | * SHA-1 Tests | |
| 137 | *****************************************************************************/ | |
| 138 | #define SHA1_TEST(data, digest) { \ | |
| 15884 | 139 | PurpleCipher *cipher = NULL; \ |
| 140 | PurpleCipherContext *context = NULL; \ | |
| 15105 | 141 | gchar cdigest[41]; \ |
| 142 | gboolean ret = FALSE; \ | |
|
29125
6a53fd54a74b
Fix annoying, but generally useless warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27539
diff
changeset
|
143 | gchar *input = data; \ |
| 15105 | 144 | \ |
| 15884 | 145 | cipher = purple_ciphers_find_cipher("sha1"); \ |
| 146 | context = purple_cipher_context_new(cipher, NULL); \ | |
| 15105 | 147 | \ |
|
29125
6a53fd54a74b
Fix annoying, but generally useless warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27539
diff
changeset
|
148 | if (input) { \ |
|
6a53fd54a74b
Fix annoying, but generally useless warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27539
diff
changeset
|
149 | purple_cipher_context_append(context, (guchar *)input, strlen(input)); \ |
| 15105 | 150 | } else { \ |
| 151 | gint j; \ | |
| 152 | guchar buff[1000]; \ | |
| 153 | \ | |
| 154 | memset(buff, 'a', 1000); \ | |
| 155 | \ | |
| 156 | for(j = 0; j < 1000; j++) \ | |
| 15884 | 157 | purple_cipher_context_append(context, buff, 1000); \ |
| 15105 | 158 | } \ |
| 159 | \ | |
|
34221
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
160 | ret = purple_cipher_context_digest_to_str(context, cdigest, sizeof(cdigest)); \ |
| 15105 | 161 | \ |
| 162 | fail_unless(ret == TRUE, NULL); \ | |
| 163 | \ | |
| 164 | fail_unless(strcmp((digest), cdigest) == 0, NULL); \ | |
| 165 | \ | |
| 15884 | 166 | purple_cipher_context_destroy(context); \ |
| 15105 | 167 | } |
| 168 | ||
|
27539
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
169 | START_TEST(test_sha1_empty_string) { |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
170 | SHA1_TEST("", "da39a3ee5e6b4b0d3255bfef95601890afd80709"); |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
171 | } |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
172 | END_TEST |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
173 | |
| 15105 | 174 | START_TEST(test_sha1_a) { |
| 175 | SHA1_TEST("a", "86f7e437faa5a7fce15d1ddcb9eaeaea377667b8"); | |
| 176 | } | |
| 177 | END_TEST | |
| 178 | ||
| 179 | START_TEST(test_sha1_abc) { | |
| 180 | SHA1_TEST("abc", "a9993e364706816aba3e25717850c26c9cd0d89d"); | |
| 181 | } | |
| 182 | END_TEST | |
| 183 | ||
| 184 | START_TEST(test_sha1_abcd_gibberish) { | |
| 185 | SHA1_TEST("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", | |
| 186 | "84983e441c3bd26ebaae4aa1f95129e5e54670f1"); | |
| 187 | } | |
| 188 | END_TEST | |
| 189 | ||
| 190 | START_TEST(test_sha1_1000_as_1000_times) { | |
| 191 | SHA1_TEST(NULL, "34aa973cd4c4daa4f61eeb2bdbad27316534016f"); | |
| 192 | } | |
| 193 | END_TEST | |
| 194 | ||
| 195 | /****************************************************************************** | |
|
27539
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
196 | * SHA-256 Tests |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
197 | *****************************************************************************/ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
198 | #define SHA256_TEST(data, digest) { \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
199 | PurpleCipher *cipher = NULL; \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
200 | PurpleCipherContext *context = NULL; \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
201 | gchar cdigest[65]; \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
202 | gboolean ret = FALSE; \ |
|
29125
6a53fd54a74b
Fix annoying, but generally useless warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27539
diff
changeset
|
203 | gchar *input = data; \ |
|
27539
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
204 | \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
205 | cipher = purple_ciphers_find_cipher("sha256"); \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
206 | context = purple_cipher_context_new(cipher, NULL); \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
207 | \ |
|
29125
6a53fd54a74b
Fix annoying, but generally useless warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27539
diff
changeset
|
208 | if (input) { \ |
|
6a53fd54a74b
Fix annoying, but generally useless warning.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27539
diff
changeset
|
209 | purple_cipher_context_append(context, (guchar *)input, strlen(input)); \ |
|
27539
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
210 | } else { \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
211 | gint j; \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
212 | guchar buff[1000]; \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
213 | \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
214 | memset(buff, 'a', 1000); \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
215 | \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
216 | for(j = 0; j < 1000; j++) \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
217 | purple_cipher_context_append(context, buff, 1000); \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
218 | } \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
219 | \ |
|
34221
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
220 | ret = purple_cipher_context_digest_to_str(context, cdigest, sizeof(cdigest)); \ |
|
27539
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
221 | \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
222 | fail_unless(ret == TRUE, NULL); \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
223 | \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
224 | fail_unless(strcmp((digest), cdigest) == 0, NULL); \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
225 | \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
226 | purple_cipher_context_destroy(context); \ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
227 | } |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
228 | |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
229 | START_TEST(test_sha256_empty_string) { |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
230 | SHA256_TEST("", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"); |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
231 | } |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
232 | END_TEST |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
233 | |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
234 | START_TEST(test_sha256_a) { |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
235 | SHA256_TEST("a", "ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb"); |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
236 | } |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
237 | END_TEST |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
238 | |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
239 | START_TEST(test_sha256_abc) { |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
240 | SHA256_TEST("abc", "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"); |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
241 | } |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
242 | END_TEST |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
243 | |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
244 | START_TEST(test_sha256_abcd_gibberish) { |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
245 | SHA256_TEST("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
246 | "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1"); |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
247 | } |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
248 | END_TEST |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
249 | |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
250 | START_TEST(test_sha256_1000_as_1000_times) { |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
251 | SHA256_TEST(NULL, "cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0"); |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
252 | } |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
253 | END_TEST |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
254 | |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
255 | /****************************************************************************** |
|
22024
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
256 | * DES Tests |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
257 | *****************************************************************************/ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
258 | #define DES_TEST(in, keyz, out, len) { \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
259 | PurpleCipher *cipher = NULL; \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
260 | PurpleCipherContext *context = NULL; \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
261 | guchar answer[len+1]; \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
262 | gint ret = 0; \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
263 | guchar decrypt[len+1] = in; \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
264 | guchar key[8+1] = keyz;\ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
265 | guchar encrypt[len+1] = out;\ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
266 | \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
267 | cipher = purple_ciphers_find_cipher("des"); \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
268 | context = purple_cipher_context_new(cipher, NULL); \ |
|
34221
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
269 | purple_cipher_context_set_key(context, key, sizeof(key)); \ |
|
22024
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
270 | \ |
|
34221
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
271 | ret = purple_cipher_context_encrypt(context, decrypt, len, answer, sizeof(answer)); \ |
|
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
272 | fail_unless(ret == len, NULL); \ |
|
22024
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
273 | fail_unless(memcmp(encrypt, answer, len) == 0, NULL); \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
274 | \ |
|
34221
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
275 | ret = purple_cipher_context_decrypt(context, encrypt, len, answer, sizeof(answer)); \ |
|
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
276 | fail_unless(ret == len, NULL); \ |
|
22024
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
277 | fail_unless(memcmp(decrypt, answer, len) == 0, NULL); \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
278 | \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
279 | purple_cipher_context_destroy(context); \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
280 | } |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
281 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
282 | START_TEST(test_des_12345678) { |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
283 | DES_TEST("12345678", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
284 | "\x3b\x38\x98\x37\x15\x20\xf7\x5e", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
285 | "\x06\x22\x05\xac\x6a\x0d\x55\xdd", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
286 | 8); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
287 | } |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
288 | END_TEST |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
289 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
290 | START_TEST(test_des_abcdefgh) { |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
291 | DES_TEST("abcdefgh", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
292 | "\x3b\x38\x98\x37\x15\x20\xf7\x5e", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
293 | "\x62\xe0\xc6\x8c\x48\xe4\x75\xed", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
294 | 8); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
295 | } |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
296 | END_TEST |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
297 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
298 | /****************************************************************************** |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
299 | * DES3 Tests |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
300 | * See http://csrc.nist.gov/groups/ST/toolkit/examples.html |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
301 | * and some NULL things I made up |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
302 | *****************************************************************************/ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
303 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
304 | #define DES3_TEST(in, key, iv, out, len, mode) { \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
305 | PurpleCipher *cipher = NULL; \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
306 | PurpleCipherContext *context = NULL; \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
307 | guchar answer[len+1]; \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
308 | guchar decrypt[len+1] = in; \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
309 | guchar encrypt[len+1] = out; \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
310 | gint ret = 0; \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
311 | \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
312 | cipher = purple_ciphers_find_cipher("des3"); \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
313 | context = purple_cipher_context_new(cipher, NULL); \ |
|
34221
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
314 | purple_cipher_context_set_key(context, (guchar *)key, sizeof(key)); \ |
|
22024
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
315 | purple_cipher_context_set_batch_mode(context, (mode)); \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
316 | purple_cipher_context_set_iv(context, (guchar *)iv, 8); \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
317 | \ |
|
34221
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
318 | ret = purple_cipher_context_encrypt(context, decrypt, len, answer, sizeof(answer)); \ |
|
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
319 | fail_unless(ret == len, NULL); \ |
|
22024
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
320 | fail_unless(memcmp(encrypt, answer, len) == 0, NULL); \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
321 | \ |
|
34221
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
322 | ret = purple_cipher_context_decrypt(context, encrypt, len, answer, sizeof(answer)); \ |
|
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
323 | fail_unless(ret == len, NULL); \ |
|
22024
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
324 | fail_unless(memcmp(decrypt, answer, len) == 0, NULL); \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
325 | \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
326 | purple_cipher_context_destroy(context); \ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
327 | } |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
328 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
329 | START_TEST(test_des3_ecb_nist1) { |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
330 | DES3_TEST( |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
331 | "\x6B\xC1\xBE\xE2\x2E\x40\x9F\x96\xE9\x3D\x7E\x11\x73\x93\x17\x2A" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
332 | "\xAE\x2D\x8A\x57\x1E\x03\xAC\x9C\x9E\xB7\x6F\xAC\x45\xAF\x8E\x51", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
333 | "\x01\x23\x45\x67\x89\xAB\xCD\xEF" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
334 | "\x23\x45\x67\x89\xAB\xCD\xEF\x01" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
335 | "\x45\x67\x89\xAB\xCD\xEF\x01\x23", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
336 | "00000000", /* ignored */ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
337 | "\x71\x47\x72\xF3\x39\x84\x1D\x34\x26\x7F\xCC\x4B\xD2\x94\x9C\xC3" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
338 | "\xEE\x11\xC2\x2A\x57\x6A\x30\x38\x76\x18\x3F\x99\xC0\xB6\xDE\x87", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
339 | 32, |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
340 | PURPLE_CIPHER_BATCH_MODE_ECB); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
341 | } |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
342 | END_TEST |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
343 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
344 | START_TEST(test_des3_ecb_nist2) { |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
345 | DES3_TEST( |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
346 | "\x6B\xC1\xBE\xE2\x2E\x40\x9F\x96\xE9\x3D\x7E\x11\x73\x93\x17\x2A" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
347 | "\xAE\x2D\x8A\x57\x1E\x03\xAC\x9C\x9E\xB7\x6F\xAC\x45\xAF\x8E\x51", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
348 | "\x01\x23\x45\x67\x89\xAB\xCD\xEF" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
349 | "\x23\x45\x67\x89\xAB\xCD\xEF\x01" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
350 | "\x01\x23\x45\x67\x89\xAB\xCD\xEF", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
351 | "00000000", /* ignored */ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
352 | "\x06\xED\xE3\xD8\x28\x84\x09\x0A\xFF\x32\x2C\x19\xF0\x51\x84\x86" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
353 | "\x73\x05\x76\x97\x2A\x66\x6E\x58\xB6\xC8\x8C\xF1\x07\x34\x0D\x3D", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
354 | 32, |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
355 | PURPLE_CIPHER_BATCH_MODE_ECB); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
356 | } |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
357 | END_TEST |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
358 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
359 | START_TEST(test_des3_ecb_null_key) { |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
360 | DES3_TEST( |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
361 | "\x16\xf4\xb3\x77\xfd\x4b\x9e\xca", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
362 | "\x38\x00\x88\x6a\xef\xcb\x00\xad" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
363 | "\x5d\xe5\x29\x00\x7d\x98\x64\x4c" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
364 | "\x86\x00\x7b\xd3\xc7\x00\x7b\x32", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
365 | "00000000", /* ignored */ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
366 | "\xc0\x60\x30\xa1\xb7\x25\x42\x44", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
367 | 8, |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
368 | PURPLE_CIPHER_BATCH_MODE_ECB); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
369 | } |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
370 | END_TEST |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
371 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
372 | START_TEST(test_des3_ecb_null_text) { |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
373 | DES3_TEST( |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
374 | "\x65\x73\x34\xc1\x19\x00\x79\x65", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
375 | "\x32\x64\xda\x10\x13\x6a\xfe\x1e" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
376 | "\x37\x54\xd1\x2c\x41\x04\x10\x40" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
377 | "\xaf\x1c\x75\x2b\x51\x3a\x03\xf5", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
378 | "00000000", /* ignored */ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
379 | "\xe5\x80\xf6\x12\xf8\x4e\xd9\x6c", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
380 | 8, |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
381 | PURPLE_CIPHER_BATCH_MODE_ECB); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
382 | } |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
383 | END_TEST |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
384 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
385 | START_TEST(test_des3_ecb_null_key_and_text) { |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
386 | DES3_TEST( |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
387 | "\xdf\x7f\x00\x92\xe7\xc1\x49\xd2", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
388 | "\x0e\x41\x00\xc4\x8b\xf0\x6e\xa1" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
389 | "\x66\x49\x42\x63\x22\x00\xf0\x99" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
390 | "\x6b\x22\xc1\x37\x9c\x00\xe4\x8f", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
391 | "00000000", /* ignored */ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
392 | "\x73\xd8\x1f\x1f\x50\x01\xe4\x79", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
393 | 8, |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
394 | PURPLE_CIPHER_BATCH_MODE_ECB); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
395 | } |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
396 | END_TEST |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
397 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
398 | START_TEST(test_des3_cbc_nist1) { |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
399 | DES3_TEST( |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
400 | "\x6B\xC1\xBE\xE2\x2E\x40\x9F\x96\xE9\x3D\x7E\x11\x73\x93\x17\x2A" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
401 | "\xAE\x2D\x8A\x57\x1E\x03\xAC\x9C\x9E\xB7\x6F\xAC\x45\xAF\x8E\x51", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
402 | "\x01\x23\x45\x67\x89\xAB\xCD\xEF" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
403 | "\x23\x45\x67\x89\xAB\xCD\xEF\x01" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
404 | "\x45\x67\x89\xAB\xCD\xEF\x01\x23", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
405 | "\xF6\x9F\x24\x45\xDF\x4F\x9B\x17", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
406 | "\x20\x79\xC3\xD5\x3A\xA7\x63\xE1\x93\xB7\x9E\x25\x69\xAB\x52\x62" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
407 | "\x51\x65\x70\x48\x1F\x25\xB5\x0F\x73\xC0\xBD\xA8\x5C\x8E\x0D\xA7", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
408 | 32, |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
409 | PURPLE_CIPHER_BATCH_MODE_CBC); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
410 | } |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
411 | END_TEST |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
412 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
413 | START_TEST(test_des3_cbc_nist2) { |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
414 | DES3_TEST( |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
415 | "\x6B\xC1\xBE\xE2\x2E\x40\x9F\x96\xE9\x3D\x7E\x11\x73\x93\x17\x2A" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
416 | "\xAE\x2D\x8A\x57\x1E\x03\xAC\x9C\x9E\xB7\x6F\xAC\x45\xAF\x8E\x51", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
417 | "\x01\x23\x45\x67\x89\xAB\xCD\xEF" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
418 | "\x23\x45\x67\x89\xAB\xCD\xEF\x01" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
419 | "\x01\x23\x45\x67\x89\xAB\xCD\xEF", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
420 | "\xF6\x9F\x24\x45\xDF\x4F\x9B\x17", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
421 | "\x74\x01\xCE\x1E\xAB\x6D\x00\x3C\xAF\xF8\x4B\xF4\x7B\x36\xCC\x21" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
422 | "\x54\xF0\x23\x8F\x9F\xFE\xCD\x8F\x6A\xCF\x11\x83\x92\xB4\x55\x81", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
423 | 32, |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
424 | PURPLE_CIPHER_BATCH_MODE_CBC); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
425 | } |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
426 | END_TEST |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
427 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
428 | START_TEST(test_des3_cbc_null_key) { |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
429 | DES3_TEST( |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
430 | "\x16\xf4\xb3\x77\xfd\x4b\x9e\xca", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
431 | "\x38\x00\x88\x6a\xef\xcb\x00\xad" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
432 | "\x5d\xe5\x29\x00\x7d\x98\x64\x4c" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
433 | "\x86\x00\x7b\xd3\xc7\x00\x7b\x32", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
434 | "\x31\x32\x33\x34\x35\x36\x37\x38", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
435 | "\x52\xe7\xde\x96\x39\x87\x87\xdb", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
436 | 8, |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
437 | PURPLE_CIPHER_BATCH_MODE_CBC); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
438 | } |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
439 | END_TEST |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
440 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
441 | START_TEST(test_des3_cbc_null_text) { |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
442 | DES3_TEST( |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
443 | "\x65\x73\x34\xc1\x19\x00\x79\x65", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
444 | "\x32\x64\xda\x10\x13\x6a\xfe\x1e" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
445 | "\x37\x54\xd1\x2c\x41\x04\x10\x40" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
446 | "\xaf\x1c\x75\x2b\x51\x3a\x03\xf5", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
447 | "\x7C\xAF\x0D\x57\x1E\x57\x10\xDA", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
448 | "\x40\x12\x0e\x00\x85\xff\x6c\xc2", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
449 | 8, |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
450 | PURPLE_CIPHER_BATCH_MODE_CBC); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
451 | } |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
452 | END_TEST |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
453 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
454 | START_TEST(test_des3_cbc_null_key_and_text) { |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
455 | DES3_TEST( |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
456 | "\xdf\x7f\x00\x92\xe7\xc1\x49\xd2", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
457 | "\x0e\x41\x00\xc4\x8b\xf0\x6e\xa1" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
458 | "\x66\x49\x42\x63\x22\x00\xf0\x99" |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
459 | "\x6b\x22\xc1\x37\x9c\x00\xe4\x8f", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
460 | "\x01\x19\x0D\x2c\x40\x67\x89\x67", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
461 | "\xa7\xc1\x10\xbe\x9b\xd5\x8a\x67", |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
462 | 8, |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
463 | PURPLE_CIPHER_BATCH_MODE_CBC); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
464 | } |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
465 | END_TEST |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
466 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
467 | /****************************************************************************** |
|
22025
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
468 | * HMAC Tests |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
469 | * See RFC2202 and some other NULL tests I made up |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
470 | *****************************************************************************/ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
471 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
472 | #define HMAC_TEST(data, data_len, key, key_len, type, digest) { \ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
473 | PurpleCipher *cipher = NULL; \ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
474 | PurpleCipherContext *context = NULL; \ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
475 | gchar cdigest[41]; \ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
476 | gboolean ret = FALSE; \ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
477 | \ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
478 | cipher = purple_ciphers_find_cipher("hmac"); \ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
479 | context = purple_cipher_context_new(cipher, NULL); \ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
480 | purple_cipher_context_set_option(context, "hash", type); \ |
|
34221
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
481 | purple_cipher_context_set_key(context, (guchar *)key, (key_len)); \ |
|
22025
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
482 | \ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
483 | purple_cipher_context_append(context, (guchar *)(data), (data_len)); \ |
|
34221
cdb480f66f8d
fixed the cipher unittests and removed some uncessary g_return_val_if_fails since the cipher api is alredy doing the check, and since the ones in the des stuff seemed to be doing the opposite of the check that the cipher api was doing
Gary Kramlich <grim@reaperworld.com>
parents:
29125
diff
changeset
|
484 | ret = purple_cipher_context_digest_to_str(context, cdigest, sizeof(cdigest)); \ |
|
22025
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
485 | \ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
486 | fail_unless(ret == TRUE, NULL); \ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
487 | fail_unless(strcmp((digest), cdigest) == 0, NULL); \ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
488 | \ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
489 | purple_cipher_context_destroy(context); \ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
490 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
491 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
492 | /* HMAC MD5 */ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
493 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
494 | START_TEST(test_hmac_md5_Hi) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
495 | HMAC_TEST("Hi There", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
496 | 8, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
497 | "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
498 | 16, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
499 | "md5", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
500 | "9294727a3638bb1c13f48ef8158bfc9d"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
501 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
502 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
503 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
504 | START_TEST(test_hmac_md5_what) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
505 | HMAC_TEST("what do ya want for nothing?", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
506 | 28, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
507 | "Jefe", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
508 | 4, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
509 | "md5", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
510 | "750c783e6ab0b503eaa86e310a5db738"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
511 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
512 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
513 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
514 | START_TEST(test_hmac_md5_dd) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
515 | HMAC_TEST("\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
516 | "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
517 | "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
518 | "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
519 | "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
520 | 50, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
521 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
522 | 16, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
523 | "md5", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
524 | "56be34521d144c88dbb8c733f0e8b3f6"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
525 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
526 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
527 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
528 | START_TEST(test_hmac_md5_cd) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
529 | HMAC_TEST("\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
530 | "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
531 | "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
532 | "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
533 | "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
534 | 50, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
535 | "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
536 | "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
537 | "\x15\x16\x17\x18\x19", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
538 | 25, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
539 | "md5", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
540 | "697eaf0aca3a3aea3a75164746ffaa79"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
541 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
542 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
543 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
544 | START_TEST(test_hmac_md5_truncation) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
545 | HMAC_TEST("Test With Truncation", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
546 | 20, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
547 | "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
548 | 16, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
549 | "md5", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
550 | "56461ef2342edc00f9bab995690efd4c"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
551 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
552 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
553 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
554 | START_TEST(test_hmac_md5_large_key) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
555 | HMAC_TEST("Test Using Larger Than Block-Size Key - Hash Key First", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
556 | 54, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
557 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
558 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
559 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
560 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
561 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
562 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
563 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
564 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
565 | 80, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
566 | "md5", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
567 | "6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
568 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
569 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
570 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
571 | START_TEST(test_hmac_md5_large_key_and_data) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
572 | HMAC_TEST("Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
573 | 73, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
574 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
575 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
576 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
577 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
578 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
579 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
580 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
581 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
582 | 80, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
583 | "md5", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
584 | "6f630fad67cda0ee1fb1f562db3aa53e"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
585 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
586 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
587 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
588 | START_TEST(test_hmac_md5_null_key) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
589 | HMAC_TEST("Hi There", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
590 | 8, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
591 | "\x0a\x0b\x00\x0d\x0e\x0f\x1a\x2f\x0b\x0b" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
592 | "\x0b\x00\x00\x0b\x0b\x49\x5f\x6e\x0b\x0b", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
593 | 20, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
594 | "md5", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
595 | "597bfd644b797a985561eeb03a169e59"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
596 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
597 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
598 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
599 | START_TEST(test_hmac_md5_null_text) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
600 | HMAC_TEST("Hi\x00There", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
601 | 8, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
602 | "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
603 | "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
604 | 20, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
605 | "md5", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
606 | "70be8e1b7b50dfcc335d6cd7992c564f"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
607 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
608 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
609 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
610 | START_TEST(test_hmac_md5_null_key_and_text) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
611 | HMAC_TEST("Hi\x00Th\x00re", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
612 | 8, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
613 | "\x0c\x0d\x00\x0f\x10\x1a\x3a\x3a\xe6\x34" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
614 | "\x0b\x00\x00\x0b\x0b\x49\x5f\x6e\x0b\x0b", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
615 | 20, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
616 | "md5", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
617 | "b31bcbba35a33a067cbba9131cba4889"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
618 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
619 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
620 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
621 | /* HMAC SHA1 */ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
622 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
623 | START_TEST(test_hmac_sha1_Hi) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
624 | HMAC_TEST("Hi There", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
625 | 8, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
626 | "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
627 | "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
628 | 20, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
629 | "sha1", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
630 | "b617318655057264e28bc0b6fb378c8ef146be00"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
631 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
632 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
633 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
634 | START_TEST(test_hmac_sha1_what) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
635 | HMAC_TEST("what do ya want for nothing?", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
636 | 28, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
637 | "Jefe", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
638 | 4, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
639 | "sha1", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
640 | "effcdf6ae5eb2fa2d27416d5f184df9c259a7c79"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
641 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
642 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
643 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
644 | START_TEST(test_hmac_sha1_dd) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
645 | HMAC_TEST("\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
646 | "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
647 | "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
648 | "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
649 | "\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd\xdd", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
650 | 50, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
651 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
652 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
653 | 20, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
654 | "sha1", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
655 | "125d7342b9ac11cd91a39af48aa17b4f63f175d3"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
656 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
657 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
658 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
659 | START_TEST(test_hmac_sha1_cd) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
660 | HMAC_TEST("\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
661 | "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
662 | "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
663 | "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
664 | "\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd\xcd", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
665 | 50, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
666 | "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
667 | "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
668 | "\x15\x16\x17\x18\x19", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
669 | 25, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
670 | "sha1", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
671 | "4c9007f4026250c6bc8414f9bf50c86c2d7235da"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
672 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
673 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
674 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
675 | START_TEST(test_hmac_sha1_truncation) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
676 | HMAC_TEST("Test With Truncation", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
677 | 20, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
678 | "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
679 | "\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
680 | 20, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
681 | "sha1", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
682 | "4c1a03424b55e07fe7f27be1d58bb9324a9a5a04"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
683 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
684 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
685 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
686 | START_TEST(test_hmac_sha1_large_key) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
687 | HMAC_TEST("Test Using Larger Than Block-Size Key - Hash Key First", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
688 | 54, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
689 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
690 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
691 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
692 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
693 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
694 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
695 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
696 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
697 | 80, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
698 | "sha1", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
699 | "aa4ae5e15272d00e95705637ce8a3b55ed402112"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
700 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
701 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
702 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
703 | START_TEST(test_hmac_sha1_large_key_and_data) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
704 | HMAC_TEST("Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
705 | 73, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
706 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
707 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
708 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
709 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
710 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
711 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
712 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
713 | "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
714 | 80, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
715 | "sha1", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
716 | "e8e99d0f45237d786d6bbaa7965c7808bbff1a91"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
717 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
718 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
719 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
720 | START_TEST(test_hmac_sha1_null_key) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
721 | HMAC_TEST("Hi There", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
722 | 8, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
723 | "\x0a\x0b\x00\x0d\x0e\x0f\x1a\x2f\x0b\x0b" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
724 | "\x0b\x00\x00\x0b\x0b\x49\x5f\x6e\x0b\x0b", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
725 | 20, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
726 | "sha1", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
727 | "eb62a2e0e33d300be669c52aab3f591bc960aac5"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
728 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
729 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
730 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
731 | START_TEST(test_hmac_sha1_null_text) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
732 | HMAC_TEST("Hi\x00There", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
733 | 8, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
734 | "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
735 | "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
736 | 20, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
737 | "sha1", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
738 | "31ca58d849e971e418e3439de2c6f83144b6abb7"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
739 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
740 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
741 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
742 | START_TEST(test_hmac_sha1_null_key_and_text) { |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
743 | HMAC_TEST("Hi\x00Th\x00re", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
744 | 8, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
745 | "\x0c\x0d\x00\x0f\x10\x1a\x3a\x3a\xe6\x34" |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
746 | "\x0b\x00\x00\x0b\x0b\x49\x5f\x6e\x0b\x0b", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
747 | 20, |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
748 | "sha1", |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
749 | "e6b8e2fede87aa09dcb13e554df1435e056eae36"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
750 | } |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
751 | END_TEST |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
752 | |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
753 | /****************************************************************************** |
| 15105 | 754 | * Suite |
| 755 | *****************************************************************************/ | |
| 756 | Suite * | |
| 757 | cipher_suite(void) { | |
| 758 | Suite *s = suite_create("Cipher Suite"); | |
| 759 | TCase *tc = NULL; | |
|
15950
0f01bb61c5d3
Fix compiler warnings and errors in tests resulting from using DEBUG_CFLAGS
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
760 | |
|
15106
e05ce518c3a4
[gaim-migrate @ 17828]
Gary Kramlich <grim@reaperworld.com>
parents:
15105
diff
changeset
|
761 | /* md4 tests */ |
| 15105 | 762 | tc = tcase_create("MD4"); |
| 763 | tcase_add_test(tc, test_md4_empty_string); | |
| 764 | tcase_add_test(tc, test_md4_a); | |
| 765 | tcase_add_test(tc, test_md4_abc); | |
| 766 | tcase_add_test(tc, test_md4_message_digest); | |
| 767 | tcase_add_test(tc, test_md4_a_to_z); | |
| 768 | tcase_add_test(tc, test_md4_A_to_Z_a_to_z_0_to_9); | |
| 769 | tcase_add_test(tc, test_md4_1_to_0_8_times); | |
| 770 | suite_add_tcase(s, tc); | |
| 771 | ||
| 772 | /* md5 tests */ | |
| 773 | tc = tcase_create("MD5"); | |
| 774 | tcase_add_test(tc, test_md5_empty_string); | |
| 775 | tcase_add_test(tc, test_md5_a); | |
| 776 | tcase_add_test(tc, test_md5_abc); | |
| 777 | tcase_add_test(tc, test_md5_message_digest); | |
| 778 | tcase_add_test(tc, test_md5_a_to_z); | |
| 779 | tcase_add_test(tc, test_md5_A_to_Z_a_to_z_0_to_9); | |
| 780 | tcase_add_test(tc, test_md5_1_to_0_8_times); | |
| 781 | suite_add_tcase(s, tc); | |
| 782 | ||
| 783 | /* sha1 tests */ | |
| 784 | tc = tcase_create("SHA1"); | |
|
27539
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
785 | tcase_add_test(tc, test_sha1_empty_string); |
| 15105 | 786 | tcase_add_test(tc, test_sha1_a); |
| 787 | tcase_add_test(tc, test_sha1_abc); | |
| 788 | tcase_add_test(tc, test_sha1_abcd_gibberish); | |
| 789 | tcase_add_test(tc, test_sha1_1000_as_1000_times); | |
| 790 | suite_add_tcase(s, tc); | |
| 791 | ||
|
27539
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
792 | /* sha256 tests */ |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
793 | tc = tcase_create("SHA256"); |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
794 | tcase_add_test(tc, test_sha256_empty_string); |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
795 | tcase_add_test(tc, test_sha256_a); |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
796 | tcase_add_test(tc, test_sha256_abc); |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
797 | tcase_add_test(tc, test_sha256_abcd_gibberish); |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
798 | tcase_add_test(tc, test_sha256_1000_as_1000_times); |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
799 | suite_add_tcase(s, tc); |
|
e94b84b12eb6
Use glib's SHA1, SHA256, and MD5 implementations when available (glib 2.16)
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
800 | |
|
22024
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
801 | /* des tests */ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
802 | tc = tcase_create("DES"); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
803 | tcase_add_test(tc, test_des_12345678); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
804 | tcase_add_test(tc, test_des_abcdefgh); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
805 | suite_add_tcase(s, tc); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
806 | |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
807 | /* des3 ecb tests */ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
808 | tc = tcase_create("DES3 ECB"); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
809 | tcase_add_test(tc, test_des3_ecb_nist1); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
810 | tcase_add_test(tc, test_des3_ecb_nist2); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
811 | tcase_add_test(tc, test_des3_ecb_null_key); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
812 | tcase_add_test(tc, test_des3_ecb_null_text); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
813 | tcase_add_test(tc, test_des3_ecb_null_key_and_text); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
814 | suite_add_tcase(s, tc); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
815 | /* des3 cbc tests */ |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
816 | tc = tcase_create("DES3 CBC"); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
817 | tcase_add_test(tc, test_des3_cbc_nist1); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
818 | tcase_add_test(tc, test_des3_cbc_nist2); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
819 | tcase_add_test(tc, test_des3_cbc_null_key); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
820 | tcase_add_test(tc, test_des3_cbc_null_text); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
821 | tcase_add_test(tc, test_des3_cbc_null_key_and_text); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
822 | suite_add_tcase(s, tc); |
|
3fd5e4fff1be
Triple DES cipher support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
20905
diff
changeset
|
823 | |
|
22025
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
824 | /* hmac tests */ |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
825 | tc = tcase_create("HMAC"); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
826 | tcase_add_test(tc, test_hmac_md5_Hi); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
827 | tcase_add_test(tc, test_hmac_md5_what); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
828 | tcase_add_test(tc, test_hmac_md5_dd); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
829 | tcase_add_test(tc, test_hmac_md5_cd); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
830 | tcase_add_test(tc, test_hmac_md5_truncation); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
831 | tcase_add_test(tc, test_hmac_md5_large_key); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
832 | tcase_add_test(tc, test_hmac_md5_large_key_and_data); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
833 | tcase_add_test(tc, test_hmac_md5_null_key); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
834 | tcase_add_test(tc, test_hmac_md5_null_text); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
835 | tcase_add_test(tc, test_hmac_md5_null_key_and_text); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
836 | tcase_add_test(tc, test_hmac_sha1_Hi); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
837 | tcase_add_test(tc, test_hmac_sha1_what); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
838 | tcase_add_test(tc, test_hmac_sha1_dd); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
839 | tcase_add_test(tc, test_hmac_sha1_cd); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
840 | tcase_add_test(tc, test_hmac_sha1_truncation); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
841 | tcase_add_test(tc, test_hmac_sha1_large_key); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
842 | tcase_add_test(tc, test_hmac_sha1_large_key_and_data); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
843 | tcase_add_test(tc, test_hmac_sha1_null_key); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
844 | tcase_add_test(tc, test_hmac_sha1_null_text); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
845 | tcase_add_test(tc, test_hmac_sha1_null_key_and_text); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
846 | suite_add_tcase(s, tc); |
|
23756775175d
HMAC digest support from Elliott Sales de Andrade
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22024
diff
changeset
|
847 | |
| 15105 | 848 | return s; |
| 849 | } | |
| 850 | ||
| 851 |