Hash-based KDF as defined in RFC 5869. More...
Go to the source code of this file.
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "util-crypto-hkdf", __VA_ARGS__) |
#define | GNUNET_BUILD 1 |
Set this to 0 if you compile this code outside of GNUnet. More... | |
#define | DEBUG_HKDF 0 |
Enable debugging. More... | |
Functions | |
static const void * | doHMAC (gcry_md_hd_t mac, const void *key, size_t key_len, const void *buf, size_t buf_len) |
Compute the HMAC. More... | |
static enum GNUNET_GenericReturnValue | getPRK (gcry_md_hd_t mac, const void *xts, size_t xts_len, const void *skm, size_t skm_len, void *prk) |
Generate pseudo-random key. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, int prf_algo, const void *xts, size_t xts_len, const void *skm, size_t skm_len, va_list argp) |
Derive key. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, int prf_algo, const void *xts, size_t xts_len, const void *skm, size_t skm_len,...) |
Derive key. More... | |
Hash-based KDF as defined in RFC 5869.
The following list of people have reviewed this code and considered it correct on the date given (if you reviewed it, please have your name added to the list):
Definition in file crypto_hkdf.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "util-crypto-hkdf", __VA_ARGS__) |
Definition at line 39 of file crypto_hkdf.c.
#define GNUNET_BUILD 1 |
Set this to 0 if you compile this code outside of GNUnet.
Definition at line 44 of file crypto_hkdf.c.
#define DEBUG_HKDF 0 |
Enable debugging.
Definition at line 49 of file crypto_hkdf.c.
|
static |
Compute the HMAC.
mac | gcrypt MAC handle |
key | HMAC key |
key_len | length of key |
buf | message to be processed |
buf_len | length of buf |
Definition at line 78 of file crypto_hkdf.c.
|
static |
Generate pseudo-random key.
mac | gcrypt HMAC handle |
xts | salt |
xts_len | length of the xts salt |
skm | source key material |
skm_len | length of skm |
prk | result buffer (allocated by caller; at least gcry_md_dlen() bytes) |
Definition at line 78 of file crypto_hkdf.c.