---
name: "kcapi_hkdf"
section: "3"
platform: "linux"
package: "libkcapi-dev"
version: "1.4.0-1+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/kcapi_hkdf"
---

# kcapi\_hkdf(3)

Extract-and-Expand HKDF (RFC5869)

## NAME

kcapi\_hkdf - Extract-and-Expand HKDF (RFC5869)

## SYNOPSIS

**ssize\_t kcapi\_hkdf(const char \*** *hashname***, const uint8\_t \*** *ikm***, size\_t** *ikmlen***, const uint8\_t \*** *salt***, uint32\_t** *saltlen***, const uint8\_t \*** *info***, size\_t** *infolen***, uint8\_t \*** *dst***, size\_t** *dlen***);**

## ARGUMENTS

*hashname*

\[in\] kernel crypto API name of a keyed hash (e.g. hmac(sha1))

*ikm*

\[in\] Input Keying Material (IKM) -- must be provided

*ikmlen*

\[in\] IKM buffer length -- must be non-zero

*salt*

\[in\] salt buffer -- may be NULL

*saltlen*

\[in\] salt buffer length -- may be zero

*info*

\[in\] info buffer -- may be NULL

*infolen*

\[in\] info buffer length -- may be zero

*dst*

\[out\] Buffer to store the generated key in,

*dlen*

\[in\] Length of the dst buffer. This value defines the number of bytes generated by the KDF.

## DESCRIPTION

Perform the key-derivation function according to RFC5869. The input data is defined in sections 2.2 und 2.3 of RFC5869.

*return* 0 upon success; a negative errno-style error code if an error occurred

## AUTHOR

**Stephan Mueller** \<smueller@chronox.de\>

Author.

## COPYRIGHT
