KCAPI_AEAD_GETDATA_O(3)

πŸ’– KCAPI_AEAD_GETDATA_O β€” bestie edition πŸ’–

okay so. this is kcapi_aead_getdata_output(3), and it lives in the libkcapi Manual 1.5.0. it's a lil service function and honestly? it's giving backstage pass energy. let's get into it πŸŽ€


✨ NAME ✨

kcapi_aead_getdata_output β€” get the pointers into output buffer

like. that's literally it. it hands you pointers. into your output buffer. that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

void kcapi_aead_getdata_output(struct kcapi_handle * handle,
                               uint8_t * encdata, size_t encdatalen,
                               int enc, uint8_t ** aad, size_t * aadlen,
                               uint8_t ** data, size_t * datalen,
                               uint8_t ** tag, size_t * taglen);

look at all those double pointers bestie 😭 she's returning everything by reference. no return value, no cap. the void is real.


🫢 ARGUMENTS 🫢

  • handle β€” [in] cipher handle. it's the handle. you know her. πŸ‘‘
  • encdata β€” [in] data buffer returned by the encryption operation
  • encdatalen β€” [in] size of the encryption data buffer
  • enc β€” [in] does output buffer hold encryption or decryption result? (yes this is the whole question, it's literally the vibe check πŸ”₯)
  • aad β€” [out] AD buffer pointer; when set to NULL, no data pointer is returned; returned pointer may also be NULL. so like β€” if you pass NULL in, you get nothing back. and even if you don't, the pointer you get back might still be NULL. double the mystery πŸ’€
  • aadlen β€” [out] length of AD; when aad was set to NULL, no information is returned
  • data β€” [out] pointer to output buffer from AEAD encryption operation when set to NULL, no data pointer is returned
  • datalen β€” [out] length of data buffer; when data was set to NULL, no information is returned
  • tag β€” [out] tag buffer pointer; when set to NULL, no data pointer is returned; returned pointer may also be NULL ✨ (same lil twist as aad, she's consistent)
  • taglen β€” [out] length of tag; when tag was set to NULL, no information is returned
ngl the pattern here is: pass NULL for the pointer, get no info for the length. pass a real pointer, get info β€” but the pointer itself might still come back NULL. that's just how she is. πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

This function is a service function to the consumer to locate the right ciphertext buffer offset holding the authentication tag. In addition, it provides the consumer with the length of the tag and the length of the ciphertext.

so basically: you've got this big ol' encdata buffer sitting there, right, and somewhere inside it is the authentication tag, and it's NOT necessarily at a cute obvious spot. this function does the findy-findy for you πŸ” so you don't have to do offset math like some kind of Victorian orphan. and while she's in there, she also tells you how long the tag is and how long the ciphertext is. multi-tasking queen. she ate and left no crumbs πŸ‘‘


🧚 AUTHOR 🧚

Stephan Mueller <smueller@chronox.de>

  • Author. (iconic of him fr fr)

libkcapi Manual 1.5.0 β€” July 2025 β€” and that's KCAPI_AEAD_GETDATA_O(3), bestie. thanks for reading my little manpage sermon, mwah πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from