File indexing completed on 2025-12-17 10:28:59
0001 #ifndef crypto_kdf_H
0002 #define crypto_kdf_H
0003
0004 #include <stddef.h>
0005 #include <stdint.h>
0006
0007 #include "crypto_kdf_blake2b.h"
0008 #include "export.h"
0009
0010 #ifdef __cplusplus
0011 # ifdef __GNUC__
0012 # pragma GCC diagnostic ignored "-Wlong-long"
0013 # endif
0014 extern "C" {
0015 #endif
0016
0017 #define crypto_kdf_BYTES_MIN crypto_kdf_blake2b_BYTES_MIN
0018 SODIUM_EXPORT
0019 size_t crypto_kdf_bytes_min(void);
0020
0021 #define crypto_kdf_BYTES_MAX crypto_kdf_blake2b_BYTES_MAX
0022 SODIUM_EXPORT
0023 size_t crypto_kdf_bytes_max(void);
0024
0025 #define crypto_kdf_CONTEXTBYTES crypto_kdf_blake2b_CONTEXTBYTES
0026 SODIUM_EXPORT
0027 size_t crypto_kdf_contextbytes(void);
0028
0029 #define crypto_kdf_KEYBYTES crypto_kdf_blake2b_KEYBYTES
0030 SODIUM_EXPORT
0031 size_t crypto_kdf_keybytes(void);
0032
0033 #define crypto_kdf_PRIMITIVE "blake2b"
0034 SODIUM_EXPORT
0035 const char *crypto_kdf_primitive(void)
0036 __attribute__ ((warn_unused_result));
0037
0038 SODIUM_EXPORT
0039 int crypto_kdf_derive_from_key(unsigned char *subkey, size_t subkey_len,
0040 uint64_t subkey_id,
0041 const char ctx[crypto_kdf_CONTEXTBYTES],
0042 const unsigned char key[crypto_kdf_KEYBYTES])
0043 __attribute__ ((nonnull));
0044
0045 SODIUM_EXPORT
0046 void crypto_kdf_keygen(unsigned char k[crypto_kdf_KEYBYTES])
0047 __attribute__ ((nonnull));
0048
0049 #ifdef __cplusplus
0050 }
0051 #endif
0052
0053 #endif