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 free iv. yes, you. not the function, not the kernel, you. that memory is yours now, it's your child, you have to let it go (with free) 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 πŸ‘‘)


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