aead_request_set_crypt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 vibe
  • cryptlen β€” number of bytes to process from src, like how much of the source we're actually touching
  • iv β€” IV for the cipher operation, and it must comply with the IV size defined by crypto_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 || plaintext
  • AEAD encryption output: assoc data || ciphertext || auth tag
  • AEAD decryption input: assoc data || ciphertext || auth tag
  • AEAD 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 🌈


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