aes_ccm_decrypt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so bestie, this is the Kernel API Manual page for aes_ccm_decrypt(9), and it does literally what it says: Decrypt a message with AES-CCM. no cap. πŸ’…


🌸 SYNOPSIS 🌸

int aes_ccm_decrypt (u8 *dst , const u8 *src , size_t data_len , const u8 *authtag , const u8 *ad , size_t ad_len , const u8 *nonce , size_t nonce_len , const struct aes_ccm_key *key );

πŸŽ€ ARGUMENTS πŸŽ€

  • dst β€” the destination plaintext data. It can be in-place or out-of-place, so she's flexible πŸ’–. For other overlaps the behavior is unspecified.
  • src β€” the source ciphertext data.
  • data_len β€” length of plaintext in bytes (and ciphertext excluding the tag): at most 2^(120 - (8 * nonce_len)) - 1.
  • authtag β€” the stored authentication tag. Length is the authtag_len that was passed to aes_ccm_preparekey. Usually protocols using AES-CCM put the tag at the end of the ciphertext, in which case this should be set to src + data_len and src must have room for the tag.
  • ad β€” the associated data.
  • ad_len β€” length of associated data in bytes.
  • nonce β€” the nonce.
  • nonce_len β€” length of the nonce in bytes: between 7 and 13 inclusive.
  • key β€” the key, already prepared using aes_ccm_preparekey.

πŸ¦‹ CONTEXT πŸ¦‹

Any context. it's giving "universally welcome" ✨.


πŸ’œ RETURN πŸ’œ

  • 0 on success. This is the only case where any decrypted or associated data can be used. like, the only only. πŸ‘‘
  • -EBADMSG if the message is inauthentic.
  • -EINVAL if nonce_len is invalid.
  • -EOVERFLOW if data_len is too large for the selected nonce_len.
bestie, pls note: if it's not 0, do not treat any decrypted or associated data as usable. that's the whole vibe check. 😭

🌈 SEE ALSO 🌈

Kernel file ./include/crypto/aes-ccm.h: struct aes_ccm_key(9), struct aes_ccm_ctx(9), aes_ccm_preparekey(9), aes_ccm_encrypt(9), aes_ccm_init(9), aes_ccm_auth_update(9), aes_ccm_encrypt_update(9), aes_ccm_decrypt_update(9), aes_ccm_encrypt_final(9), aes_ccm_decrypt_final(9).


mwah πŸ’‹ this iconic little page comes from ./include/crypto and is dated October 2026 β€” go off, kernel docs. 🫢

πŸ“¦ where this page comes from