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)

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