---
name: "kcapi_kdf_fb"
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_kdf_fb"
---

# kcapi\_kdf\_fb(3)

Feedback Mode Key Derivation Function

## NAME

kcapi\_kdf\_fb - Feedback Mode Key Derivation Function

## SYNOPSIS

**ssize\_t kcapi\_kdf\_fb(struct kcapi\_handle \*** *handle***, const uint8\_t \*** *src***, size\_t** *slen***, uint8\_t \*** *dst***, size\_t** *dlen***);**

## ARGUMENTS

*handle*

\[in\] cipher handle allocated by caller. This cipher handle must be allocated with **kcapi\_md\_init**. If the caller is interested in a KDF using a keyed message digest, the caller should also call **kcapi\_md\_setkey** before invoking this function.

*src*

\[in\] Input data that should be transformed into a key (see below).

*slen*

\[in\] Length of the src input data.

*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

This function is an implementation of the KDF in feedback mode with a non-NULL IV and with counter according to SP800-108 section 5.2. The IV is supplied with src and must be equal to the digestsize of the used cipher.

In addition, the caller must provide Label \|\| 0x00 \|\| Context in src. This src pointer must not be NULL as the IV is required. The ultimate format of the src pointer is IV \|\| Label \|\| 0x00 \|\| Context where the length of the IV is equal to the block size (i.e. the digest size of the underlying hash) of the PRF.

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

## AUTHOR

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

Author.

## COPYRIGHT
