include/crypto/skcipher.h
Source file repositories/reference/linux-study-clean/include/crypto/skcipher.h
File Facts
- System
- Linux kernel
- Corpus path
include/crypto/skcipher.h- Extension
.h- Size
- 33464 bytes
- Lines
- 942
- 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/string.hlinux/types.h
Detected Declarations
struct scatterliststruct skcipher_requeststruct crypto_skcipherstruct crypto_sync_skcipherstruct crypto_lskcipherstruct skcipher_algstruct SKCIPHER_ALG_COMMONstruct lskcipher_algfunction crypto_sync_skcipher_tfmfunction crypto_free_skcipherfunction crypto_free_sync_skcipherfunction crypto_free_lskcipherfunction crypto_skcipher_ivsizefunction crypto_sync_skcipher_ivsizefunction crypto_lskcipher_ivsizefunction crypto_skcipher_blocksizefunction crypto_lskcipher_blocksizefunction crypto_skcipher_chunksizefunction crypto_lskcipher_chunksizefunction crypto_skcipher_statesizefunction crypto_lskcipher_statesizefunction crypto_sync_skcipher_blocksizefunction crypto_skcipher_alignmaskfunction crypto_lskcipher_alignmaskfunction crypto_skcipher_get_flagsfunction crypto_skcipher_set_flagsfunction crypto_skcipher_clear_flagsfunction crypto_sync_skcipher_get_flagsfunction crypto_sync_skcipher_set_flagsfunction crypto_sync_skcipher_clear_flagsfunction crypto_lskcipher_get_flagsfunction crypto_lskcipher_set_flagsfunction crypto_lskcipher_clear_flagsfunction crypto_sync_skcipher_setkeyfunction crypto_skcipher_min_keysizefunction crypto_skcipher_max_keysizefunction crypto_lskcipher_min_keysizefunction crypto_lskcipher_max_keysizefunction crypto_skcipher_reqtfmfunction handlefunction skcipher_request_set_tfmfunction skcipher_request_set_sync_tfmfunction skcipher_request_allocfunction skcipher_request_freefunction skcipher_request_zerofunction callback_functionfunction skcipher_request_set_crypt
Annotated Snippet
struct skcipher_request {
unsigned int cryptlen;
u8 *iv;
struct scatterlist *src;
struct scatterlist *dst;
struct crypto_async_request base;
void *__ctx[] CRYPTO_MINALIGN_ATTR;
};
struct crypto_skcipher {
unsigned int reqsize;
struct crypto_tfm base;
};
struct crypto_sync_skcipher {
struct crypto_skcipher base;
};
struct crypto_lskcipher {
struct crypto_tfm base;
};
/*
* struct skcipher_alg_common - common properties of skcipher_alg
* @min_keysize: Minimum key size supported by the transformation. This is the
* smallest key length supported by this transformation algorithm.
* This must be set to one of the pre-defined values as this is
* not hardware specific. Possible values for this field can be
* found via git grep "_MIN_KEY_SIZE" include/crypto/
* @max_keysize: Maximum key size supported by the transformation. This is the
* largest key length supported by this transformation algorithm.
* This must be set to one of the pre-defined values as this is
* not hardware specific. Possible values for this field can be
* found via git grep "_MAX_KEY_SIZE" include/crypto/
* @ivsize: IV size applicable for transformation. The consumer must provide an
* IV of exactly that size to perform the encrypt or decrypt operation.
* @chunksize: Equal to the block size except for stream ciphers such as
* CTR where it is set to the underlying block size.
* @statesize: Size of the internal state for the algorithm.
* @base: Definition of a generic crypto algorithm.
*/
#define SKCIPHER_ALG_COMMON { \
unsigned int min_keysize; \
unsigned int max_keysize; \
unsigned int ivsize; \
unsigned int chunksize; \
unsigned int statesize; \
\
struct crypto_alg base; \
}
struct skcipher_alg_common SKCIPHER_ALG_COMMON;
/**
* struct skcipher_alg - symmetric key cipher definition
* @setkey: Set key for the transformation. This function is used to either
* program a supplied key into the hardware or store the key in the
* transformation context for programming it later. Note that this
* function does modify the transformation context. This function can
* be called multiple times during the existence of the transformation
* object, so one must make sure the key is properly reprogrammed into
* the hardware. This function is also responsible for checking the key
* length for validity. In case a software fallback was put in place in
* the @cra_init call, this function might need to use the fallback if
* the algorithm doesn't support all of the key sizes.
* @encrypt: Encrypt a scatterlist of blocks. This function is used to encrypt
* the supplied scatterlist containing the blocks of data. The crypto
* API consumer is responsible for aligning the entries of the
* scatterlist properly and making sure the chunks are correctly
* sized. In case a software fallback was put in place in the
* @cra_init call, this function might need to use the fallback if
* the algorithm doesn't support all of the key sizes. In case the
* key was stored in transformation context, the key might need to be
* re-programmed into the hardware in this function. This function
* shall not modify the transformation context, as this function may
* be called in parallel with the same transformation object.
* @decrypt: Decrypt a single block. This is a reverse counterpart to @encrypt
* and the conditions are exactly the same.
* @export: Export partial state of the transformation. This function dumps the
* entire state of the ongoing transformation into a provided block of
* data so it can be @import 'ed back later on. This is useful in case
* you want to save partial result of the transformation after
* processing certain amount of data and reload this partial result
* multiple times later on for multiple re-use. No data processing
* happens at this point.
* @import: Import partial state of the transformation. This function loads the
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/container_of.h`, `linux/crypto.h`, `linux/slab.h`, `linux/string.h`, `linux/types.h`.
- Detected declarations: `struct scatterlist`, `struct skcipher_request`, `struct crypto_skcipher`, `struct crypto_sync_skcipher`, `struct crypto_lskcipher`, `struct skcipher_alg`, `struct SKCIPHER_ALG_COMMON`, `struct lskcipher_alg`, `function crypto_sync_skcipher_tfm`, `function crypto_free_skcipher`.
- 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.