KCAPI_AEAD_CCM_NONCE(3)
π KCAPI_AEAD_CCM_NONCE β bestie edition π
okay so real talk, this is a page from the libkcapi manual, section 3, and it's about one very specific little glow-up: turning a CCM nonce into an IV. no cap, that's literally the whole job. let's get into it π¦
β¨ NAME β¨
kcapi_aead_ccm_nonce_to_iv β convert CCM nonce into IV
like... it does exactly what it says on the tin. it's giving "no thoughts, just conversion" π
πΈ SYNOPSIS πΈ
int kcapi_aead_ccm_nonce_to_iv(const uint8_t * nonce, uint32_t noncelen,
uint8_t ** iv, uint32_t * ivlen);
π ARGUMENTS π
bestie, here's who's who in this function's group chat:
nonceβ[in]the buffer with the nonce. that's the thing you're handing over πnoncelenβ[in]how long that nonce is. yes, we need to know. no, we can't guess π’ivβ[out]a newly allocated buffer holding the IV. it's fresh, it's new, it's main character energy πivlenβ[out]the length of that IV. so you know what you got β¨
π DESCRIPTION π
so this service function does one iconic thing: it converts a CCM nonce value into an IV that the kernel crypto API can actually use. that's it. that's the vibe. it's a glow-up, a transformation arc, a whole makeover montage for your nonce π§
β οΈ important, bestie: the caller must freeiv. yes, you. not the function, not the kernel, you. that memory is yours now, it's your child, you have to let it go (withfree) when you're done. don't be the person who leaks π
and for the return value:
0β success!! slay, we ate π< 0β failure π something went wrong, no IV for you
π AUTHOR π
Stephan Mueller <smueller@chronox.de> Author. (yes that's the whole credit line, we stan a concise king π)
π COPYRIGHT π
this is the libkcapi Manual, version 1.5.0, from July 2025. that's the source and the date, and yes it's giving official, it's giving documented, it's giving "read the manual bestie" π«Ά
okay that's the whole page! go forth and convert those nonces, and remember to free(iv) β periodt πβ¨πΈ
π¦ 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