26static void test_pbkdf2_vectors(
void) {
38 (
const uint8_t *)
"\x0c\x60\xc8\x0f\x96\x1f\x0e\x71\xf3\xa9\xb5\x24\xaf"
39 "\x60\x12\x06\x2f\xe0\x37\xa6",
42 (
const uint8_t *)
"\xea\x6c\x01\x4d\xc7\x2d\x6f\x8c\xcd\x1e\xd9\x2a\xce"
43 "\x1d\x41\xf0\xd8\xde\x89\x57",
46 (
const uint8_t *)
"\x4b\x00\x79\x01\xb7\x65\x48\x9a\xbe\xad\x49\xd9\x26"
47 "\xf7\x21\xd0\x65\xa4\x29\xc1",
53 {(
const uint8_t *)
"passwordPASSWORDpassword", 24,
54 (
const uint8_t *)
"saltSALTsaltSALTsaltSALTsaltSALTsalt", 36, 4096,
_SHA1,
55 (
const uint8_t *)
"\x3d\x2e\xec\x4f\xe4\x1c\x84\x9b\x80\xc8\xd8\x36\x62"
56 "\xc0\xe4\x4a\x8b\x29\x1a\x96\x4c\xf2\xf0\x70\x38",
58 {(
const uint8_t *)
"pass\0word", 9, (
const uint8_t *)
"sa\0lt", 5, 4096,
61 *)
"\x56\xfa\x6a\xa7\x55\x48\x09\x9d\xcc\x37\xd7\xf0\x34\x25\xe0\xc3",
65 for (
size_t i = 0; i <
sizeof(vectors) /
sizeof(vectors[0]); i++) {
68 vectors[i].salt, vectors[i].salt_len,
69 vectors[i].iterations, vectors[i].hash, key,
72 assert(memcmp(key, vectors[i].output, vectors[i].size) == 0);
76int main(
void) { test_pbkdf2_vectors(); }
bool pkcs5_pbkdf2_hmac(const uint8_t *password, size_t cb_password, const uint8_t *salt, size_t cb_salt, uint64_t iterations, hash_t hash, uint8_t *key, size_t cb_key)
unsigned __int64 uint64_t