1 /*
2  * SPDX-FileCopyrightText: 2015 Joseph Birr-Pixton <jpixton@gmail.com>
3  *
4  * SPDX-License-Identifier: CC0-1.0
5  */
6 
7 /*
8  * fastpbkdf2 - Faster PBKDF2-HMAC calculation
9  * Written in 2015 by Joseph Birr-Pixton <jpixton@gmail.com>
10  *
11  * To the extent possible under law, the author(s) have dedicated all
12  * copyright and related and neighboring rights to this software to the
13  * public domain worldwide. This software is distributed without any
14  * warranty.
15  *
16  * You should have received a copy of the CC0 Public Domain Dedication
17  * along with this software. If not, see
18  * <http://creativecommons.org/publicdomain/zero/1.0/>.
19  */
20 
21 #ifndef FASTPBKDF2_H
22 #define FASTPBKDF2_H
23 
24 #include <stdlib.h>
25 #include <stdint.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 /** Calculates PBKDF2-HMAC-SHA1.
32  *
33  *  @p npw bytes at @p pw are the password input.
34  *  @p nsalt bytes at @p salt are the salt input.
35  *  @p iterations is the PBKDF2 iteration count and must be non-zero.
36  *  @p nout bytes of output are written to @p out.  @p nout must be non-zero.
37  *
38  *  This function cannot fail; it does not report errors.
39  */
40 void fastpbkdf2_hmac_sha1(const uint8_t *pw, size_t npw,
41                           const uint8_t *salt, size_t nsalt,
42                           uint32_t iterations,
43                           uint8_t *out, size_t nout);
44 #ifdef __cplusplus
45 }
46 #endif
47 
48 #endif
49