KCAPI_AEAD_SETKEY(3)
π KCAPI_AEAD_SETKEY β setting the key for your AEAD handle π
okay so bestie, welcome to kcapi_aead_setkey from section 3 of the libkcapi manual, aka the little function that hands your secret key over to the kernel so your AEAD handle can actually do stuff. let's get into it π«Ά
β¨ SYNOPSIS β¨
int kcapi_aead_setkey(struct kcapi_handle * handle, const uint8_t * key,
uint32_t keylen);
π ARGUMENTS π
handleβ [in] the cipher handle, your main character, the one you already opened. it's the thing receiving the key β¨keyβ [in] the key buffer. yes, that key. the secret one πkeylenβ [in] the length of the key buffer, because the kernel is not a mind reader and needs to know how many bytes to look at π
πΈ DESCRIPTION πΈ
so basically, with this function the caller sets the key for all the encryption or decryption operations that come after it. it's giving "here's the vibe, now go do your thing" π₯
the way that this works is: after the caller has handed over the key, the caller may securely destroy the key β because at that point it's maintained by the kernel. your copy is no longer needed, so wipe it, queen π§β¨
π and the return situation: it returns 0 upon success; a negative errno-style error code if an error occurred. so like, zero means slay, negative means something went wrong, no cap.
π AUTHOR π
Stephan Mueller <smueller@chronox.de>
- Author. π (iconic of him, fr fr)
π COPYRIGHT π
this whole thing is from the libkcapi Manual, version 1.5.0, dated July 2025. go forth and set those keys, bestie β you ate, 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