KCAPI_CIPHER_DEC_AES(3)
π KCAPI_CIPHER_DEC_AES β bestie edition π
ok so like. this is kcapi_cipher_dec_aes_ctr, a lil convenience function living in the libkcapi manual (section 3, for the girlies who read man pages for fun π). she's a one-call wonder for AES CTR decryption and she is so easy to love.
β¨ NAME β¨
kcapi_cipher_dec_aes_ctr β the convenience function for AES CTR decryption. no cap, that's literally her whole job description π
πΈ SYNOPSIS πΈ
ssize_t kcapi_cipher_dec_aes_ctr(const uint8_t * key, uint32_t keylen,
const uint8_t * in, size_t inlen,
const uint8_t * ctr, uint8_t * out,
size_t outlen);
she returns an ssize_t, she takes seven args, and she does not want to hear your opinions about it π«Ά
π¦ ARGUMENTS π¦
ok bestie here's the whole cast, in order, main character first:
keyβ[in]the key buffer. this is the secret, guard her with your life πkeylenβ[in]length of the key buffer. yes this matters a lot, keep reading.inβ[in]the ciphertext data buffer. this is the messy locked-up stuff coming in.inlenβ[in]length of theinbuffer.ctrβ[in]the start counter value to be used for the cipher operation. iconic, 16 bytes, no substitutions.outβ[out]the plaintext data buffer. this is where the glow-up lands β¨outlenβ[in]length of theoutbuffer.
π« DESCRIPTION π«
so what does she actually do? the convenience function performs an AES counter mode encryption operation using the provided key, the given input buffer and the given IV. the output is stored in the out buffer. one call, done, periodt.
the input buffer can be of arbitrary length. no notes, she eats any size.
the output buffer must be at least as large as the input buffer. so like, don't skimp on out, she needs room to breathe π
the start counter can contain all zeros β and lowkey that's fine, that's valid β but not a NULL buffer! a NULL is a hard no. also she must be exactly 16 bytes in size. exactly. not 15, not 17. sixteen. π
the AES type (AES-128, AES-192 or AES-256) is determined by the size of the given key, so like, the key length is the vibe check:
- a 16 byte key means
AES-128is used. - a 24 byte key implies
AES-192. - a 32 byte key implies
AES-256.
and the return value? on success she hands you the number of bytes generated; if something went wrong you get a negative errno-style error code. negative = not slay, check your errno π¨
real talk: this is the decryption convenience wrapper, but the description says it performs an AES counter mode encryption operation β CTR mode is symmetric like that, so don't come for me, I'm just telling you what the page says π
π AUTHOR π
- Stephan Mueller
<smueller@chronox.de>β Author. the legend, the blueprint, the moment β
π COPYRIGHT π
that's the whole page bestie, you're fully caught up π§
sending you off with the receipts: this came from the libkcapi Manual, version 1.5.0, dated July 2025, and the page is KCAPI_CIPHER_DEC_AES(3). go decrypt something cute ππ¦πΈ
π¦ 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