include/crypto/akcipher.h
Source file repositories/reference/linux-study-clean/include/crypto/akcipher.h
File Facts
- System
- Linux kernel
- Corpus path
include/crypto/akcipher.h- Extension
.h- Size
- 11589 bytes
- Lines
- 379
- 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/crypto.h
Detected Declarations
struct akcipher_requeststruct crypto_akcipherstruct akcipher_algfunction crypto_akcipher_reqsizefunction akcipher_request_set_tfmfunction crypto_free_akcipherfunction akcipher_request_allocfunction akcipher_request_freefunction akcipher_request_set_callbackfunction akcipher_request_set_cryptfunction crypto_akcipher_maxsizefunction crypto_akcipher_encryptfunction crypto_akcipher_decryptfunction crypto_akcipher_set_pub_keyfunction crypto_akcipher_set_priv_key
Annotated Snippet
struct akcipher_request {
struct crypto_async_request base;
struct scatterlist *src;
struct scatterlist *dst;
unsigned int src_len;
unsigned int dst_len;
void *__ctx[] CRYPTO_MINALIGN_ATTR;
};
/**
* struct crypto_akcipher - user-instantiated objects which encapsulate
* algorithms and core processing logic
*
* @reqsize: Request context size required by algorithm implementation
* @base: Common crypto API algorithm data structure
*/
struct crypto_akcipher {
unsigned int reqsize;
struct crypto_tfm base;
};
/**
* struct akcipher_alg - generic public key cipher algorithm
*
* @encrypt: Function performs an encrypt operation as defined by public key
* algorithm. In case of error, where the dst_len was insufficient,
* the req->dst_len will be updated to the size required for the
* operation
* @decrypt: Function performs a decrypt operation as defined by public key
* algorithm. In case of error, where the dst_len was insufficient,
* the req->dst_len will be updated to the size required for the
* operation
* @set_pub_key: Function invokes the algorithm specific set public key
* function, which knows how to decode and interpret
* the BER encoded public key and parameters
* @set_priv_key: Function invokes the algorithm specific set private key
* function, which knows how to decode and interpret
* the BER encoded private key and parameters
* @max_size: Function returns dest buffer size required for a given key.
* @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: Common crypto API algorithm data structure
*/
struct akcipher_alg {
int (*encrypt)(struct akcipher_request *req);
int (*decrypt)(struct akcipher_request *req);
int (*set_pub_key)(struct crypto_akcipher *tfm, const void *key,
unsigned int keylen);
int (*set_priv_key)(struct crypto_akcipher *tfm, const void *key,
unsigned int keylen);
unsigned int (*max_size)(struct crypto_akcipher *tfm);
int (*init)(struct crypto_akcipher *tfm);
void (*exit)(struct crypto_akcipher *tfm);
struct crypto_alg base;
};
/**
* DOC: Generic Public Key Cipher API
*
* The Public Key Cipher API is used with the algorithms of type
* CRYPTO_ALG_TYPE_AKCIPHER (listed as type "akcipher" in /proc/crypto)
*/
/**
* crypto_alloc_akcipher() - allocate AKCIPHER tfm handle
* @alg_name: is the cra_name / name or cra_driver_name / driver name of the
* public key algorithm e.g. "rsa"
* @type: specifies the type of the algorithm
* @mask: specifies the mask for the algorithm
*
* Allocate a handle for public key algorithm. The returned struct
* crypto_akcipher is the handle that is required for any subsequent
* API invocation for the public key operations.
*
* Return: allocated handle in case of success; IS_ERR() is true in case
* of an error, PTR_ERR() returns the error code.
*/
struct crypto_akcipher *crypto_alloc_akcipher(const char *alg_name, u32 type,
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/crypto.h`.
- Detected declarations: `struct akcipher_request`, `struct crypto_akcipher`, `struct akcipher_alg`, `function crypto_akcipher_reqsize`, `function akcipher_request_set_tfm`, `function crypto_free_akcipher`, `function akcipher_request_alloc`, `function akcipher_request_free`, `function akcipher_request_set_callback`, `function akcipher_request_set_crypt`.
- 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.