aead_request_set_crypt(9)
πΈ NAME πΈ
okay so bestie, this is aead_request_set_crypt from the Kernel API Manual, and its official NAME vibe is set data buffers β literally, that's the whole thing. the function is called aead_request_set_crypt, and it's giving βshort name, big responsibilitiesβ and honestly? iconic π
.
β¨ SYNOPSIS β¨
void aead_request_set_crypt (struct aead_request *req , struct scatterlist *src , struct scatterlist *dst , unsigned int cryptlen , u8 *iv );
π ARGUMENTS π
reqβ the request handle, your main character struct β¨srcβ source scatter / gather list, yes with the slash, that's just how it is π¦dstβ destination scatter / gather list, the other half of the vibecryptlenβ number of bytes to process fromsrc, like how much of the source we're actually touchingivβ IV for the cipher operation, and it must comply with the IV size defined bycrypto_aead_ivsizeπ this is not a drill
π DESCRIPTION π
so what this does is set the source data and destination data scatter / gather lists β and those lists hold the associated data concatenated with the plaintext or ciphertext. the authentication tag? that's below, bestie, keep reading π«Ά.
for encryption, the source is treated as the plaintext and the destination is the ciphertext. for a decryption operation, the use is reversed β the source is the ciphertext and the destination is the plaintext. the way that swap is so simple but so important π.
the memory structure for the cipher operation has the following structure:
AEAD encryption input: assoc data || plaintextAEAD encryption output: assoc data || ciphertext || auth tagAEAD decryption input: assoc data || ciphertext || auth tagAEAD decryption output: assoc data || plaintext
okay important caveat, no cap: albeit the kernel requires the presence of the AAD buffer, however, the kernel does not fill the AAD buffer in the output case. if the caller wants to have that data buffer filled, the caller must either use an in-place cipher operation (i.e. same memory location for input/output memory location). not me expecting it to be filled π β it is literally not filled unless you do the in-place thing. periodt.
π SEE ALSO π
- Kernel file
./include/crypto/aead.hAuthenticated Encryption With Associated Data (AEAD) Cipher API(9) struct aead_request(9)struct aead_alg(9)crypto_alloc_aead(9)crypto_free_aead(9)crypto_has_aead(9)crypto_aead_ivsize(9)crypto_aead_authsize(9)crypto_aead_blocksize(9)crypto_aead_setkey(9)crypto_aead_setauthsize(9)crypto_aead_encrypt(9)crypto_aead_decrypt(9)- Asynchronous AEAD Request Handle(9)
crypto_aead_reqsize(9)aead_request_set_tfm(9)aead_request_alloc(9)aead_request_free(9)aead_request_set_callback(9)aead_request_set_ad(9)
okay bye bestie π this page lives under ./include/crypto, dated October 2026, and it's the aead_request_set_crypt(9) manual from the Kernel API Manual. slay, stay hydrated, and may your scatter / gather lists always be exactly where you expect them πΈβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms