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 operationencdatalenβ [in] size of the encryption data bufferencβ [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 toNULL, no data pointer is returned; returned pointer may also beNULL. so like β if you passNULLin, you get nothing back. and even if you don't, the pointer you get back might still beNULL. double the mystery πaadlenβ [out] length of AD; whenaadwas set toNULL, no information is returneddataβ [out] pointer to output buffer from AEAD encryption operation when set toNULL, no data pointer is returneddatalenβ [out] length of data buffer; whendatawas set toNULL, no information is returnedtagβ [out] tag buffer pointer; when set toNULL, no data pointer is returned; returned pointer may also beNULLβ¨ (same lil twist asaad, she's consistent)taglenβ [out] length of tag; whentagwas set toNULL, no information is returned
ngl the pattern here is: passNULLfor the pointer, get no info for the length. pass a real pointer, get info β but the pointer itself might still come backNULL. 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)
π COPYRIGHT π
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
- 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