include/crypto/aead.h
Source file repositories/reference/linux-study-clean/include/crypto/aead.h
File Facts
- System
- Linux kernel
- Corpus path
include/crypto/aead.h- Extension
.h- Size
- 21717 bytes
- Lines
- 631
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/atomic.hlinux/container_of.hlinux/crypto.hlinux/slab.hlinux/types.h
Detected Declarations
struct crypto_aeadstruct scatterliststruct aead_requeststruct aead_algstruct crypto_aeadstruct crypto_sync_aeadfunction crypto_sync_aead_tfmfunction crypto_free_aeadfunction crypto_free_sync_aeadfunction crypto_aead_alg_ivsizefunction crypto_aead_ivsizefunction crypto_sync_aead_ivsizefunction crypto_aead_authsizefunction crypto_sync_aead_authsizefunction crypto_aead_alg_maxauthsizefunction crypto_aead_maxauthsizefunction crypto_sync_aead_maxauthsizefunction crypto_aead_blocksizefunction crypto_sync_aead_blocksizefunction crypto_aead_alignmaskfunction crypto_aead_get_flagsfunction crypto_aead_set_flagsfunction crypto_aead_clear_flagsfunction crypto_sync_aead_get_flagsfunction crypto_sync_aead_set_flagsfunction crypto_sync_aead_clear_flagsfunction crypto_sync_aead_setkeyfunction crypto_sync_aead_setauthsizefunction crypto_aead_reqsizefunction aead_request_set_tfmfunction aead_request_set_sync_tfmfunction aead_request_allocfunction aead_request_freefunction callback_functionfunction crypto_aead_ivsizefunction aead_request_set_ad
Annotated Snippet
struct aead_request {
struct crypto_async_request base;
unsigned int assoclen;
unsigned int cryptlen;
u8 *iv;
struct scatterlist *src;
struct scatterlist *dst;
void *__ctx[] CRYPTO_MINALIGN_ATTR;
};
/**
* struct aead_alg - AEAD cipher definition
* @maxauthsize: Set the maximum authentication tag size supported by the
* transformation. A transformation may support smaller tag sizes.
* As the authentication tag is a message digest to ensure the
* integrity of the encrypted data, a consumer typically wants the
* largest authentication tag possible as defined by this
* variable.
* @setauthsize: Set authentication size for the AEAD transformation. This
* function is used to specify the consumer requested size of the
* authentication tag to be either generated by the transformation
* during encryption or the size of the authentication tag to be
* supplied during the decryption operation. This function is also
* responsible for checking the authentication tag size for
* validity.
* @setkey: see struct skcipher_alg
* @encrypt: see struct skcipher_alg
* @decrypt: see struct skcipher_alg
* @ivsize: see struct skcipher_alg
* @chunksize: see struct skcipher_alg
* @init: Initialize the cryptographic transformation object. This function
* is used to initialize the cryptographic transformation object.
* This function is called only once at the instantiation time, right
* after the transformation context was allocated. In case the
* cryptographic hardware has some special requirements which need to
* be handled by software, this function shall check for the precise
* requirement of the transformation and put any software fallbacks
* in place.
* @exit: Deinitialize the cryptographic transformation object. This is a
* counterpart to @init, used to remove various changes set in
* @init.
* @base: Definition of a generic crypto cipher algorithm.
*
* All fields except @ivsize is mandatory and must be filled.
*/
struct aead_alg {
int (*setkey)(struct crypto_aead *tfm, const u8 *key,
unsigned int keylen);
int (*setauthsize)(struct crypto_aead *tfm, unsigned int authsize);
int (*encrypt)(struct aead_request *req);
int (*decrypt)(struct aead_request *req);
int (*init)(struct crypto_aead *tfm);
void (*exit)(struct crypto_aead *tfm);
unsigned int ivsize;
unsigned int maxauthsize;
unsigned int chunksize;
struct crypto_alg base;
};
struct crypto_aead {
unsigned int authsize;
unsigned int reqsize;
struct crypto_tfm base;
};
struct crypto_sync_aead {
struct crypto_aead base;
};
#define MAX_SYNC_AEAD_REQSIZE 384
#define SYNC_AEAD_REQUEST_ON_STACK(name, _tfm) \
char __##name##_desc[sizeof(struct aead_request) + \
MAX_SYNC_AEAD_REQSIZE \
] CRYPTO_MINALIGN_ATTR; \
struct aead_request *name = \
(((struct aead_request *)__##name##_desc)->base.tfm = \
crypto_sync_aead_tfm((_tfm)), \
(void *)__##name##_desc)
static inline struct crypto_aead *__crypto_aead_cast(struct crypto_tfm *tfm)
{
return container_of(tfm, struct crypto_aead, base);
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/container_of.h`, `linux/crypto.h`, `linux/slab.h`, `linux/types.h`.
- Detected declarations: `struct crypto_aead`, `struct scatterlist`, `struct aead_request`, `struct aead_alg`, `struct crypto_aead`, `struct crypto_sync_aead`, `function crypto_sync_aead_tfm`, `function crypto_free_aead`, `function crypto_free_sync_aead`, `function crypto_aead_alg_ivsize`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.