crypto_aead_decrypt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… crypto_aead_decrypt β€” Kernel API Manual

okay bestie, buckle up, we're doing kernel crypto today ✨ this is crypto_aead_decrypt(9), straight out of the Kernel API Manual, and honestly? she's iconic.


🌸 NAME 🌸

crypto_aead_decrypt β€” decrypt ciphertext. that's it. that's the whole job. she decrypts. πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

int crypto_aead_decrypt (struct aead_request *req );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • req β€” a reference to the aead_request handle that's holding all the info needed to actually run the cipher operation. think of it as the little purse πŸ‘œ carrying everything the crypto op needs. no purse, no decrypt, periodt.

✨ DESCRIPTION ✨

so what does she do? she decrypts ciphertext data using that aead_request handle. the whole deal with that data structure β€” like, how it gets filled up with data in the first place β€” is discussed over with the aead_request_* functions. go read those if you're lost, iykyk. 🫢

⚠️ IMPORTANT NOTE ⚠️ the caller must concatenate the ciphertext followed by the authentication data / tag. and that authentication data / tag has to have the size defined by the crypto_aead_setauthsize invocation. no cap, if you get this order or size wrong, the auth check is gonna fail and you're gonna have a bad time. 😭

πŸ”₯ RETURN πŸ”₯

  • 0 β€” cipher operation was successful, slay, we ate. πŸ‘‘
  • -EBADMSG β€” so here's the thing: an AEAD cipher operation performs authentication of the data during the decryption operation. that means this error comes back when the authentication of the ciphertext was unsuccessful β€” i.e. the integrity of the ciphertext or the associated data was violated. πŸ’€ somebody tampered with something, or something got messed up.
  • < 0 β€” if an error occurred. any other negative value, basically. it's giving "something went wrong, check your vibes." πŸ™ˆ

🌈 SEE ALSO 🌈

go read the kernel file ./include/crypto/aead.h and the Authenticated Encryption With Associated Data (AEAD) Cipher API(9), plus all these besties:


and that's the whole page, bestie 🧚✨ this one came from ./include/crypto, dated October 2026, in the Kernel API Manual β€” literally stamped and everything. go forth and decrypt responsibly πŸ’œπŸ“

πŸ“¦ where this page comes from