libsodium (1.0.19)
1 #ifndef crypto_kdf_H
2 #define crypto_kdf_H
3
4 #include <stddef.h>
5 #include <stdint.h>
6
7 #include "crypto_kdf_blake2b.h"
8 #include "export.h"
9
10 #ifdef __cplusplus
11 # ifdef __GNUC__
12 # pragma GCC diagnostic ignored "-Wlong-long"
13 # endif
14 extern "C" {
15 #endif
16
17 #define crypto_kdf_BYTES_MIN crypto_kdf_blake2b_BYTES_MIN
18 SODIUM_EXPORT
19 size_t crypto_kdf_bytes_min(void);
20
21 #define crypto_kdf_BYTES_MAX crypto_kdf_blake2b_BYTES_MAX
22 SODIUM_EXPORT
23 size_t crypto_kdf_bytes_max(void);
24
25 #define crypto_kdf_CONTEXTBYTES crypto_kdf_blake2b_CONTEXTBYTES
26 SODIUM_EXPORT
27 size_t crypto_kdf_contextbytes(void);
28
29 #define crypto_kdf_KEYBYTES crypto_kdf_blake2b_KEYBYTES
30 SODIUM_EXPORT
31 size_t crypto_kdf_keybytes(void);
32
33 #define crypto_kdf_PRIMITIVE "blake2b"
34 SODIUM_EXPORT
35 const char *crypto_kdf_primitive(void)
36 __attribute__ ((warn_unused_result));
37
38 SODIUM_EXPORT
39 int crypto_kdf_derive_from_key(unsigned char *subkey, size_t subkey_len,
40 uint64_t subkey_id,
41 const char ctx[crypto_kdf_CONTEXTBYTES],
42 const unsigned char key[crypto_kdf_KEYBYTES])
43 __attribute__ ((nonnull));
44
45 SODIUM_EXPORT
46 void crypto_kdf_keygen(unsigned char k[crypto_kdf_KEYBYTES])
47 __attribute__ ((nonnull));
48
49 #ifdef __cplusplus
50 }
51 #endif
52
53 #endif