KCAPI_KDF_DPI(3)
π KCAPI_KDF_DPI π
okay so bestie, we're in the kcapi_kdf_dpi page from the libkcapi manual, and it's literally the Double Pipeline Mode Key Derivation Function. yes it's a mouthful. no you don't have to say it out loud. let's get into it π
β¨ SYNOPSIS β¨
ssize_t kcapi_kdf_dpi(struct kcapi_handle * handle, const uint8_t * src,
size_t slen, uint8_t * dst, size_t dlen);
look at her. one function, five args, zero drama. π
πΈ ARGUMENTS πΈ
handleβ [in] the cipher handle that you, the caller, allocated. and babes, listen: it must be allocated withkcapi_md_init. and if you're out here wanting a KDF that uses a keyed message digest? then you also need to callkcapi_md_setkeybefore you invoke this function. don't skip that step, i'm begging π«Άsrcβ [in] the input data that should be transformed into a key (peep the DESCRIPTION below for the tea).slenβ [in] the length of thesrcinput data. yes, the whole thing. don't be shy.dstβ [out] the buffer where your freshly generated key gets stored. she's the output, she's the moment. πdlenβ [in] the length of thedstbuffer. and this value? it literally defines the number of bytes generated by the KDF. so whatever number you put here is how many bytes you're getting. periodt.
π DESCRIPTION π
so this function is an implementation of the KDF in double pipeline iteration mode β according with counter β to SP800-108 section 5.3. no cap, that's the spec.
and here's the part you cannot skip: the caller must provide Label || 0x00 || Context in src. that's the exact format, bestie, pipe-pipe and all. β¨
but also β plot twist β that src pointer may also be NULL if the caller wishes not to provide anything. so like. it's optional-optional. iconic behaviour honestly.
oh and the return? 0 upon success; a negative errno-style error code if an error occurred. that's it, that's the vibe check.
π¦ AUTHOR π¦
- Stephan Mueller
<smueller@chronox.de>β Author. yeah, he wrote it. main character energy fr fr. π
π COPYRIGHT π
and that's the whole page, bestie!! this was the kcapi_kdf_dpi(3) situation, brought to you by the libkcapi Manual 1.5.0, dated July 2025. mwah, slay, go derive some keys responsibly ππ
β¨
π¦ where this page comes from
- fedora 43: libkcapi-devel 1.5.0-6.fc43 Β· BSD-3-Clause OR GPL-2.0-only
- fedora 43: libkcapi-devel 1.5.0-6.fc43 Β· BSD-3-Clause OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms