test_crypto_slow.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. /* Copyright (c) 2001-2004, Roger Dingledine.
  2. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  3. * Copyright (c) 2007-2015, The Tor Project, Inc. */
  4. /* See LICENSE for licensing information */
  5. #include "orconfig.h"
  6. #define CRYPTO_S2K_PRIVATE
  7. #include "or.h"
  8. #include "test.h"
  9. #include "crypto_s2k.h"
  10. #include "crypto_pwbox.h"
  11. #if defined(HAVE_LIBSCRYPT_H)
  12. #include <libscrypt.h>
  13. #endif
  14. #include <openssl/evp.h>
  15. /** Run unit tests for our secret-to-key passphrase hashing functionality. */
  16. static void
  17. test_crypto_s2k_rfc2440(void *arg)
  18. {
  19. char buf[29];
  20. char buf2[29];
  21. char *buf3 = NULL;
  22. int i;
  23. (void)arg;
  24. memset(buf, 0, sizeof(buf));
  25. memset(buf2, 0, sizeof(buf2));
  26. buf3 = tor_malloc(65536);
  27. memset(buf3, 0, 65536);
  28. secret_to_key_rfc2440(buf+9, 20, "", 0, buf);
  29. crypto_digest(buf2+9, buf3, 1024);
  30. tt_mem_op(buf,OP_EQ, buf2, 29);
  31. memcpy(buf,"vrbacrda",8);
  32. memcpy(buf2,"vrbacrda",8);
  33. buf[8] = 96;
  34. buf2[8] = 96;
  35. secret_to_key_rfc2440(buf+9, 20, "12345678", 8, buf);
  36. for (i = 0; i < 65536; i += 16) {
  37. memcpy(buf3+i, "vrbacrda12345678", 16);
  38. }
  39. crypto_digest(buf2+9, buf3, 65536);
  40. tt_mem_op(buf,OP_EQ, buf2, 29);
  41. done:
  42. tor_free(buf3);
  43. }
  44. static void
  45. run_s2k_tests(const unsigned flags, const unsigned type,
  46. int speclen, const int keylen, int legacy)
  47. {
  48. uint8_t buf[S2K_MAXLEN], buf2[S2K_MAXLEN], buf3[S2K_MAXLEN];
  49. int r;
  50. size_t sz;
  51. const char pw1[] = "You can't come in here unless you say swordfish!";
  52. const char pw2[] = "Now, I give you one more guess.";
  53. r = secret_to_key_new(buf, sizeof(buf), &sz,
  54. pw1, strlen(pw1), flags);
  55. tt_int_op(r, OP_EQ, S2K_OKAY);
  56. tt_int_op(buf[0], OP_EQ, type);
  57. tt_int_op(sz, OP_EQ, keylen + speclen);
  58. if (legacy) {
  59. memmove(buf, buf+1, sz-1);
  60. --sz;
  61. --speclen;
  62. }
  63. tt_int_op(S2K_OKAY, OP_EQ,
  64. secret_to_key_check(buf, sz, pw1, strlen(pw1)));
  65. tt_int_op(S2K_BAD_SECRET, OP_EQ,
  66. secret_to_key_check(buf, sz, pw2, strlen(pw2)));
  67. /* Move key to buf2, and clear it. */
  68. memset(buf3, 0, sizeof(buf3));
  69. memcpy(buf2, buf+speclen, keylen);
  70. memset(buf+speclen, 0, sz - speclen);
  71. /* Derivekey should produce the same results. */
  72. tt_int_op(S2K_OKAY, OP_EQ,
  73. secret_to_key_derivekey(buf3, keylen, buf, speclen, pw1, strlen(pw1)));
  74. tt_mem_op(buf2, OP_EQ, buf3, keylen);
  75. /* Derivekey with a longer output should fill the output. */
  76. memset(buf2, 0, sizeof(buf2));
  77. tt_int_op(S2K_OKAY, OP_EQ,
  78. secret_to_key_derivekey(buf2, sizeof(buf2), buf, speclen,
  79. pw1, strlen(pw1)));
  80. tt_mem_op(buf2, OP_NE, buf3, sizeof(buf2));
  81. memset(buf3, 0, sizeof(buf3));
  82. tt_int_op(S2K_OKAY, OP_EQ,
  83. secret_to_key_derivekey(buf3, sizeof(buf3), buf, speclen,
  84. pw1, strlen(pw1)));
  85. tt_mem_op(buf2, OP_EQ, buf3, sizeof(buf3));
  86. tt_assert(!tor_mem_is_zero((char*)buf2+keylen, sizeof(buf2)-keylen));
  87. done:
  88. ;
  89. }
  90. static void
  91. test_crypto_s2k_general(void *arg)
  92. {
  93. const char *which = arg;
  94. if (!strcmp(which, "scrypt")) {
  95. run_s2k_tests(0, 2, 19, 32, 0);
  96. } else if (!strcmp(which, "scrypt-low")) {
  97. run_s2k_tests(S2K_FLAG_LOW_MEM, 2, 19, 32, 0);
  98. } else if (!strcmp(which, "pbkdf2")) {
  99. run_s2k_tests(S2K_FLAG_USE_PBKDF2, 1, 18, 20, 0);
  100. } else if (!strcmp(which, "rfc2440")) {
  101. run_s2k_tests(S2K_FLAG_NO_SCRYPT, 0, 10, 20, 0);
  102. } else if (!strcmp(which, "rfc2440-legacy")) {
  103. run_s2k_tests(S2K_FLAG_NO_SCRYPT, 0, 10, 20, 1);
  104. } else {
  105. tt_fail();
  106. }
  107. }
  108. #if defined(HAVE_LIBSCRYPT_H) && defined(HAVE_EVP_PBE_SCRYPT)
  109. static void
  110. test_libscrypt_eq_openssl(void *arg)
  111. {
  112. uint8_t buf1[64];
  113. uint8_t buf2[64];
  114. uint64_t N, r, p;
  115. uint64_t maxmem = 0; // --> SCRYPT_MAX_MEM in OpenSSL.
  116. int libscrypt_retval, openssl_retval;
  117. size_t dk_len = 64;
  118. (void)arg;
  119. memset(buf1,0,64);
  120. memset(buf2,0,64);
  121. /* NOTE: we're using N,r the way OpenSSL and libscrypt define them,
  122. * not the way draft-josefsson-scrypt-kdf-00.txt define them.
  123. */
  124. N = 16;
  125. r = 1;
  126. p = 1;
  127. libscrypt_retval =
  128. libscrypt_scrypt((const uint8_t *)"", 0, (const uint8_t *)"", 0,
  129. N, r, p, buf1, dk_len);
  130. openssl_retval =
  131. EVP_PBE_scrypt((const char *)"", 0, (const unsigned char *)"", 0,
  132. N, r, p, maxmem, buf2, dk_len);
  133. tt_int_op(libscrypt_retval, ==, 0);
  134. tt_int_op(openssl_retval, ==, 1);
  135. tt_mem_op(buf1, ==, buf2, 64);
  136. memset(buf1,0,64);
  137. memset(buf2,0,64);
  138. N = 1024;
  139. r = 8;
  140. p = 16;
  141. libscrypt_retval =
  142. libscrypt_scrypt((const uint8_t *)"password", strlen("password"),
  143. (const uint8_t *)"NaCl", strlen("NaCl"),
  144. N, r, p, buf1, dk_len);
  145. openssl_retval =
  146. EVP_PBE_scrypt((const char *)"password", strlen("password"),
  147. (const unsigned char *)"NaCl", strlen("NaCl"),
  148. N, r, p, maxmem, buf2, dk_len);
  149. tt_int_op(libscrypt_retval, ==, 0);
  150. tt_int_op(openssl_retval, ==, 1);
  151. tt_mem_op(buf1, ==, buf2, 64);
  152. memset(buf1,0,64);
  153. memset(buf2,0,64);
  154. N = 16384;
  155. r = 8;
  156. p = 1;
  157. libscrypt_retval =
  158. libscrypt_scrypt((const uint8_t *)"pleaseletmein",
  159. strlen("pleaseletmein"),
  160. (const uint8_t *)"SodiumChloride",
  161. strlen("SodiumChloride"),
  162. N, r, p, buf1, dk_len);
  163. openssl_retval =
  164. EVP_PBE_scrypt((const char *)"pleaseletmein",
  165. strlen("pleaseletmein"),
  166. (const unsigned char *)"SodiumChloride",
  167. strlen("SodiumChloride"),
  168. N, r, p, maxmem, buf2, dk_len);
  169. tt_int_op(libscrypt_retval, ==, 0);
  170. tt_int_op(openssl_retval, ==, 1);
  171. tt_mem_op(buf1, ==, buf2, 64);
  172. memset(buf1,0,64);
  173. memset(buf2,0,64);
  174. N = 1048576;
  175. maxmem = 2 * 1024 * 1024 * (uint64_t)1024; // 2 GB
  176. libscrypt_retval =
  177. libscrypt_scrypt((const uint8_t *)"pleaseletmein",
  178. strlen("pleaseletmein"),
  179. (const uint8_t *)"SodiumChloride",
  180. strlen("SodiumChloride"),
  181. N, r, p, buf1, dk_len);
  182. openssl_retval =
  183. EVP_PBE_scrypt((const char *)"pleaseletmein",
  184. strlen("pleaseletmein"),
  185. (const unsigned char *)"SodiumChloride",
  186. strlen("SodiumChloride"),
  187. N, r, p, maxmem, buf2, dk_len);
  188. tt_int_op(libscrypt_retval, ==, 0);
  189. tt_int_op(openssl_retval, ==, 1);
  190. tt_mem_op(buf1, ==, buf2, 64);
  191. done:
  192. return;
  193. }
  194. #endif
  195. static void
  196. test_crypto_s2k_errors(void *arg)
  197. {
  198. uint8_t buf[S2K_MAXLEN], buf2[S2K_MAXLEN];
  199. size_t sz;
  200. (void)arg;
  201. /* Bogus specifiers: simple */
  202. tt_int_op(S2K_BAD_LEN, OP_EQ,
  203. secret_to_key_derivekey(buf, sizeof(buf),
  204. (const uint8_t*)"", 0, "ABC", 3));
  205. tt_int_op(S2K_BAD_ALGORITHM, OP_EQ,
  206. secret_to_key_derivekey(buf, sizeof(buf),
  207. (const uint8_t*)"\x10", 1, "ABC", 3));
  208. tt_int_op(S2K_BAD_LEN, OP_EQ,
  209. secret_to_key_derivekey(buf, sizeof(buf),
  210. (const uint8_t*)"\x01\x02", 2, "ABC", 3));
  211. tt_int_op(S2K_BAD_LEN, OP_EQ,
  212. secret_to_key_check((const uint8_t*)"", 0, "ABC", 3));
  213. tt_int_op(S2K_BAD_ALGORITHM, OP_EQ,
  214. secret_to_key_check((const uint8_t*)"\x10", 1, "ABC", 3));
  215. tt_int_op(S2K_BAD_LEN, OP_EQ,
  216. secret_to_key_check((const uint8_t*)"\x01\x02", 2, "ABC", 3));
  217. /* too long gets "BAD_LEN" too */
  218. memset(buf, 0, sizeof(buf));
  219. buf[0] = 2;
  220. tt_int_op(S2K_BAD_LEN, OP_EQ,
  221. secret_to_key_derivekey(buf2, sizeof(buf2),
  222. buf, sizeof(buf), "ABC", 3));
  223. /* Truncated output */
  224. #ifdef HAVE_LIBSCRYPT_H
  225. tt_int_op(S2K_TRUNCATED, OP_EQ, secret_to_key_new(buf, 50, &sz,
  226. "ABC", 3, 0));
  227. tt_int_op(S2K_TRUNCATED, OP_EQ, secret_to_key_new(buf, 50, &sz,
  228. "ABC", 3, S2K_FLAG_LOW_MEM));
  229. #endif
  230. tt_int_op(S2K_TRUNCATED, OP_EQ, secret_to_key_new(buf, 37, &sz,
  231. "ABC", 3, S2K_FLAG_USE_PBKDF2));
  232. tt_int_op(S2K_TRUNCATED, OP_EQ, secret_to_key_new(buf, 29, &sz,
  233. "ABC", 3, S2K_FLAG_NO_SCRYPT));
  234. #ifdef HAVE_LIBSCRYPT_H
  235. tt_int_op(S2K_TRUNCATED, OP_EQ, secret_to_key_make_specifier(buf, 18, 0));
  236. tt_int_op(S2K_TRUNCATED, OP_EQ, secret_to_key_make_specifier(buf, 18,
  237. S2K_FLAG_LOW_MEM));
  238. #endif
  239. tt_int_op(S2K_TRUNCATED, OP_EQ, secret_to_key_make_specifier(buf, 17,
  240. S2K_FLAG_USE_PBKDF2));
  241. tt_int_op(S2K_TRUNCATED, OP_EQ, secret_to_key_make_specifier(buf, 9,
  242. S2K_FLAG_NO_SCRYPT));
  243. /* Now try using type-specific bogus specifiers. */
  244. /* It's a bad pbkdf2 buffer if it has an iteration count that would overflow
  245. * int32_t. */
  246. memset(buf, 0, sizeof(buf));
  247. buf[0] = 1; /* pbkdf2 */
  248. buf[17] = 100; /* 1<<100 is much bigger than INT32_MAX */
  249. tt_int_op(S2K_BAD_PARAMS, OP_EQ,
  250. secret_to_key_derivekey(buf2, sizeof(buf2),
  251. buf, 18, "ABC", 3));
  252. #ifdef HAVE_LIBSCRYPT_H
  253. /* It's a bad scrypt buffer if N would overflow uint64 */
  254. memset(buf, 0, sizeof(buf));
  255. buf[0] = 2; /* scrypt */
  256. buf[17] = 100; /* 1<<100 is much bigger than UINT64_MAX */
  257. tt_int_op(S2K_BAD_PARAMS, OP_EQ,
  258. secret_to_key_derivekey(buf2, sizeof(buf2),
  259. buf, 19, "ABC", 3));
  260. #endif
  261. done:
  262. ;
  263. }
  264. static void
  265. test_crypto_scrypt_vectors(void *arg)
  266. {
  267. char *mem_op_hex_tmp = NULL;
  268. uint8_t spec[64], out[64];
  269. (void)arg;
  270. #ifndef HAVE_LIBSCRYPT_H
  271. if (1)
  272. tt_skip();
  273. #endif
  274. /* Test vectors from
  275. http://tools.ietf.org/html/draft-josefsson-scrypt-kdf-00 section 11.
  276. Note that the names of 'r' and 'N' are switched in that section. Or
  277. possibly in libscrypt.
  278. */
  279. base16_decode((char*)spec, sizeof(spec),
  280. "0400", 4);
  281. memset(out, 0x00, sizeof(out));
  282. tt_int_op(64, OP_EQ,
  283. secret_to_key_compute_key(out, 64, spec, 2, "", 0, 2));
  284. test_memeq_hex(out,
  285. "77d6576238657b203b19ca42c18a0497"
  286. "f16b4844e3074ae8dfdffa3fede21442"
  287. "fcd0069ded0948f8326a753a0fc81f17"
  288. "e8d3e0fb2e0d3628cf35e20c38d18906");
  289. base16_decode((char*)spec, sizeof(spec),
  290. "4e61436c" "0A34", 12);
  291. memset(out, 0x00, sizeof(out));
  292. tt_int_op(64, OP_EQ,
  293. secret_to_key_compute_key(out, 64, spec, 6, "password", 8, 2));
  294. test_memeq_hex(out,
  295. "fdbabe1c9d3472007856e7190d01e9fe"
  296. "7c6ad7cbc8237830e77376634b373162"
  297. "2eaf30d92e22a3886ff109279d9830da"
  298. "c727afb94a83ee6d8360cbdfa2cc0640");
  299. base16_decode((char*)spec, sizeof(spec),
  300. "536f6469756d43686c6f72696465" "0e30", 32);
  301. memset(out, 0x00, sizeof(out));
  302. tt_int_op(64, OP_EQ,
  303. secret_to_key_compute_key(out, 64, spec, 16,
  304. "pleaseletmein", 13, 2));
  305. test_memeq_hex(out,
  306. "7023bdcb3afd7348461c06cd81fd38eb"
  307. "fda8fbba904f8e3ea9b543f6545da1f2"
  308. "d5432955613f0fcf62d49705242a9af9"
  309. "e61e85dc0d651e40dfcf017b45575887");
  310. base16_decode((char*)spec, sizeof(spec),
  311. "536f6469756d43686c6f72696465" "1430", 32);
  312. memset(out, 0x00, sizeof(out));
  313. tt_int_op(64, OP_EQ,
  314. secret_to_key_compute_key(out, 64, spec, 16,
  315. "pleaseletmein", 13, 2));
  316. test_memeq_hex(out,
  317. "2101cb9b6a511aaeaddbbe09cf70f881"
  318. "ec568d574a2ffd4dabe5ee9820adaa47"
  319. "8e56fd8f4ba5d09ffa1c6d927c40f4c3"
  320. "37304049e8a952fbcbf45c6fa77a41a4");
  321. done:
  322. tor_free(mem_op_hex_tmp);
  323. }
  324. static void
  325. test_crypto_pbkdf2_vectors(void *arg)
  326. {
  327. char *mem_op_hex_tmp = NULL;
  328. uint8_t spec[64], out[64];
  329. (void)arg;
  330. /* Test vectors from RFC6070, section 2 */
  331. base16_decode((char*)spec, sizeof(spec),
  332. "73616c74" "00" , 10);
  333. memset(out, 0x00, sizeof(out));
  334. tt_int_op(20, OP_EQ,
  335. secret_to_key_compute_key(out, 20, spec, 5, "password", 8, 1));
  336. test_memeq_hex(out, "0c60c80f961f0e71f3a9b524af6012062fe037a6");
  337. base16_decode((char*)spec, sizeof(spec),
  338. "73616c74" "01" , 10);
  339. memset(out, 0x00, sizeof(out));
  340. tt_int_op(20, OP_EQ,
  341. secret_to_key_compute_key(out, 20, spec, 5, "password", 8, 1));
  342. test_memeq_hex(out, "ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957");
  343. base16_decode((char*)spec, sizeof(spec),
  344. "73616c74" "0C" , 10);
  345. memset(out, 0x00, sizeof(out));
  346. tt_int_op(20, OP_EQ,
  347. secret_to_key_compute_key(out, 20, spec, 5, "password", 8, 1));
  348. test_memeq_hex(out, "4b007901b765489abead49d926f721d065a429c1");
  349. base16_decode((char*)spec, sizeof(spec),
  350. "73616c74" "18" , 10);
  351. memset(out, 0x00, sizeof(out));
  352. tt_int_op(20, OP_EQ,
  353. secret_to_key_compute_key(out, 20, spec, 5, "password", 8, 1));
  354. test_memeq_hex(out, "eefe3d61cd4da4e4e9945b3d6ba2158c2634e984");
  355. base16_decode((char*)spec, sizeof(spec),
  356. "73616c7453414c5473616c7453414c5473616c745"
  357. "3414c5473616c7453414c5473616c74" "0C" , 74);
  358. memset(out, 0x00, sizeof(out));
  359. tt_int_op(25, OP_EQ,
  360. secret_to_key_compute_key(out, 25, spec, 37,
  361. "passwordPASSWORDpassword", 24, 1));
  362. test_memeq_hex(out, "3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038");
  363. base16_decode((char*)spec, sizeof(spec),
  364. "7361006c74" "0c" , 12);
  365. memset(out, 0x00, sizeof(out));
  366. tt_int_op(16, OP_EQ,
  367. secret_to_key_compute_key(out, 16, spec, 6, "pass\0word", 9, 1));
  368. test_memeq_hex(out, "56fa6aa75548099dcc37d7f03425e0c3");
  369. done:
  370. tor_free(mem_op_hex_tmp);
  371. }
  372. static void
  373. test_crypto_pwbox(void *arg)
  374. {
  375. uint8_t *boxed=NULL, *decoded=NULL;
  376. size_t len, dlen;
  377. unsigned i;
  378. const char msg[] = "This bunny reminds you that you still have a "
  379. "salamander in your sylladex. She is holding the bunny Dave got you. "
  380. "It’s sort of uncanny how similar they are, aside from the knitted "
  381. "enhancements. Seriously, what are the odds?? So weird.";
  382. const char pw[] = "I'm a night owl and a wise bird too";
  383. const unsigned flags[] = { 0,
  384. S2K_FLAG_NO_SCRYPT,
  385. S2K_FLAG_LOW_MEM,
  386. S2K_FLAG_NO_SCRYPT|S2K_FLAG_LOW_MEM,
  387. S2K_FLAG_USE_PBKDF2 };
  388. (void)arg;
  389. for (i = 0; i < ARRAY_LENGTH(flags); ++i) {
  390. tt_int_op(0, OP_EQ, crypto_pwbox(&boxed, &len,
  391. (const uint8_t*)msg, strlen(msg),
  392. pw, strlen(pw), flags[i]));
  393. tt_assert(boxed);
  394. tt_assert(len > 128+32);
  395. tt_int_op(0, OP_EQ, crypto_unpwbox(&decoded, &dlen, boxed, len,
  396. pw, strlen(pw)));
  397. tt_assert(decoded);
  398. tt_uint_op(dlen, OP_EQ, strlen(msg));
  399. tt_mem_op(decoded, OP_EQ, msg, dlen);
  400. tor_free(decoded);
  401. tt_int_op(UNPWBOX_BAD_SECRET, OP_EQ, crypto_unpwbox(&decoded, &dlen,
  402. boxed, len,
  403. pw, strlen(pw)-1));
  404. boxed[len-1] ^= 1;
  405. tt_int_op(UNPWBOX_BAD_SECRET, OP_EQ, crypto_unpwbox(&decoded, &dlen,
  406. boxed, len,
  407. pw, strlen(pw)));
  408. boxed[0] = 255;
  409. tt_int_op(UNPWBOX_CORRUPTED, OP_EQ, crypto_unpwbox(&decoded, &dlen,
  410. boxed, len,
  411. pw, strlen(pw)));
  412. tor_free(boxed);
  413. }
  414. done:
  415. tor_free(boxed);
  416. tor_free(decoded);
  417. }
  418. #define CRYPTO_LEGACY(name) \
  419. { #name, test_crypto_ ## name , 0, NULL, NULL }
  420. struct testcase_t slow_crypto_tests[] = {
  421. CRYPTO_LEGACY(s2k_rfc2440),
  422. #ifdef HAVE_LIBSCRYPT_H
  423. { "s2k_scrypt", test_crypto_s2k_general, 0, &passthrough_setup,
  424. (void*)"scrypt" },
  425. { "s2k_scrypt_low", test_crypto_s2k_general, 0, &passthrough_setup,
  426. (void*)"scrypt-low" },
  427. #ifdef HAVE_EVP_PBE_SCRYPT
  428. { "libscrypt_eq_openssl", test_libscrypt_eq_openssl, 0, NULL, NULL },
  429. #endif
  430. #endif
  431. { "s2k_pbkdf2", test_crypto_s2k_general, 0, &passthrough_setup,
  432. (void*)"pbkdf2" },
  433. { "s2k_rfc2440_general", test_crypto_s2k_general, 0, &passthrough_setup,
  434. (void*)"rfc2440" },
  435. { "s2k_rfc2440_legacy", test_crypto_s2k_general, 0, &passthrough_setup,
  436. (void*)"rfc2440-legacy" },
  437. { "s2k_errors", test_crypto_s2k_errors, 0, NULL, NULL },
  438. { "scrypt_vectors", test_crypto_scrypt_vectors, 0, NULL, NULL },
  439. { "pbkdf2_vectors", test_crypto_pbkdf2_vectors, 0, NULL, NULL },
  440. { "pwbox", test_crypto_pwbox, 0, NULL, NULL },
  441. END_OF_TESTCASES
  442. };