2 * Written in 2013 by Gregor Pintar <grpintar@gmail.com>
4 * To the extent possible under law, the author(s) have dedicated
5 * all copyright and related and neighboring rights to this software
6 * to the public domain worldwide.
8 * This software is distributed without any warranty.
10 * You should have received a copy of the CC0 Public Domain Dedication.
11 * If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
17 #include <kripto/mac/hmac.h>
18 #include <kripto/hash/sha1.h>
19 #include <kripto/pbkdf2.h>
23 const uint8_t out
[20] =
25 0x4B, 0x00, 0x79, 0x01,
26 0xB7, 0x65, 0x48, 0x9A,
27 0xBE, 0xAD, 0x49, 0xD9,
28 0x26, 0xF7, 0x21, 0xD0,
29 0x65, 0xA4, 0x29, 0xC1
48 perror("kripto_pbkdf2() returned error");
52 for(i
= 0; i
< 20; i
++) if(buf
[i
] != out
[i
])
54 fputs("kripto_pbkdf2: FAIL\n", stderr
);
58 puts("kripto_pbkdf2: OK");