HMAC-based key derivation function based on Xoodyak-HMAC.
More...
#include <stddef.h>
Go to the source code of this file.
|
#define | XOODYAK_HKDF_OUTPUT_SIZE 32 |
| Default output block size for Xoodyak-HKDF. Key material is generated in blocks of this size.
|
|
|
int | xoodyak_hkdf (unsigned char *out, size_t outlen, const unsigned char *key, size_t keylen, const unsigned char *salt, size_t saltlen, const unsigned char *info, size_t infolen) |
| Derives key material using Xoodyak-HKDF. More...
|
|
void | xoodyak_hkdf_extract (xoodyak_hkdf_state_t *state, const unsigned char *key, size_t keylen, const unsigned char *salt, size_t saltlen) |
| Extracts entropy from a key and salt for Xoodyak-HKDF. More...
|
|
int | xoodyak_hkdf_expand (xoodyak_hkdf_state_t *state, const unsigned char *info, size_t infolen, unsigned char *out, size_t outlen) |
| Expands key material using a Xoodyak-HKDF state. More...
|
|
void | xoodyak_hkdf_free (xoodyak_hkdf_state_t *state) |
| Frees all sensitive material in a Xoodyak-HKDF state. More...
|
|
HMAC-based key derivation function based on Xoodyak-HMAC.
Reference: https://tools.ietf.org/html/rfc5869
int xoodyak_hkdf |
( |
unsigned char * |
out, |
|
|
size_t |
outlen, |
|
|
const unsigned char * |
key, |
|
|
size_t |
keylen, |
|
|
const unsigned char * |
salt, |
|
|
size_t |
saltlen, |
|
|
const unsigned char * |
info, |
|
|
size_t |
infolen |
|
) |
| |
Derives key material using Xoodyak-HKDF.
- Parameters
-
out | Points to the output buffer to receive the key material. |
outlen | Number of bytes of key material to generate, maximum of XOODYAK_HKDF_OUTPUT_SIZE * 255 bytes. |
key | Points to the bytes of the key. |
keylen | Number of bytes in the key. |
salt | Points to the bytes of the salt. |
saltlen | Number of bytes in the salt. |
info | Points to the bytes of the informational data. |
infolen | Number of bytes in the informational data. |
- Returns
- Zero on success or -1 if outlen is out of range.
- See Also
- xoodyak_hkdf_extract(), xoodyak_hkdf_expand()
int xoodyak_hkdf_expand |
( |
xoodyak_hkdf_state_t * |
state, |
|
|
const unsigned char * |
info, |
|
|
size_t |
infolen, |
|
|
unsigned char * |
out, |
|
|
size_t |
outlen |
|
) |
| |
Expands key material using a Xoodyak-HKDF state.
- Parameters
-
state | HKDF state to use to expand key material. |
info | Points to the bytes of the informational data. |
infolen | Number of bytes in the informational data. |
out | Points to the output buffer to receive the key material. |
outlen | Number of bytes of key material to generate. |
- Returns
- Zero on success or -1 if too many bytes have been generated so far. There is a limit of XOODYAK_HKDF_OUTPUT_SIZE * 255 bytes.
void xoodyak_hkdf_extract |
( |
xoodyak_hkdf_state_t * |
state, |
|
|
const unsigned char * |
key, |
|
|
size_t |
keylen, |
|
|
const unsigned char * |
salt, |
|
|
size_t |
saltlen |
|
) |
| |
Extracts entropy from a key and salt for Xoodyak-HKDF.
- Parameters
-
state | HKDF state to be initialized. |
key | Points to the bytes of the key. |
keylen | Number of bytes in the key. |
salt | Points to the bytes of the salt. |
saltlen | Number of bytes in the salt. |
- See Also
- xoodyak_hkdf_expand(), xoodyak_hkdf()
Frees all sensitive material in a Xoodyak-HKDF state.
- Parameters
-
state | Points to the HKDF state. |