include/crypto/internal/kpp.h
Source file repositories/reference/linux-study-clean/include/crypto/internal/kpp.h
File Facts
- System
- Linux kernel
- Corpus path
include/crypto/internal/kpp.h- Extension
.h- Size
- 7206 bytes
- Lines
- 246
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
crypto/kpp.hcrypto/algapi.h
Detected Declarations
struct kpp_instancestruct crypto_kpp_spawnfunction kpp_set_reqsizefunction kpp_set_reqsize_dmafunction kpp_request_completefunction kpp_crypto_instancefunction kpp_instancefunction kpp_alg_instancefunction kpp_instance_ctxfunction crypto_drop_kppfunction crypto_spawn_kpp_algfunction crypto_spawn_kpp
Annotated Snippet
struct kpp_instance {
void (*free)(struct kpp_instance *inst);
union {
struct {
char head[offsetof(struct kpp_alg, base)];
struct crypto_instance base;
} s;
struct kpp_alg alg;
};
};
/**
* struct crypto_kpp_spawn - KPP algorithm spawn
* @base: Internal. Generic crypto core spawn state.
*
* Template instances can get a hold on some inner KPP algorithm by
* binding a &struct crypto_kpp_spawn via
* crypto_grab_kpp(). Transforms may subsequently get instantiated
* from the referenced inner &struct kpp_alg by means of
* crypto_spawn_kpp().
*/
struct crypto_kpp_spawn {
struct crypto_spawn base;
};
/*
* Transform internal helpers.
*/
static inline void *kpp_request_ctx(struct kpp_request *req)
{
return req->__ctx;
}
static inline void *kpp_request_ctx_dma(struct kpp_request *req)
{
unsigned int align = crypto_dma_align();
if (align <= crypto_tfm_ctx_alignment())
align = 1;
return PTR_ALIGN(kpp_request_ctx(req), align);
}
static inline void kpp_set_reqsize(struct crypto_kpp *kpp,
unsigned int reqsize)
{
kpp->reqsize = reqsize;
}
static inline void kpp_set_reqsize_dma(struct crypto_kpp *kpp,
unsigned int reqsize)
{
reqsize += crypto_dma_align() & ~(crypto_tfm_ctx_alignment() - 1);
kpp->reqsize = reqsize;
}
static inline void *kpp_tfm_ctx(struct crypto_kpp *tfm)
{
return crypto_tfm_ctx(&tfm->base);
}
static inline void *kpp_tfm_ctx_dma(struct crypto_kpp *tfm)
{
return crypto_tfm_ctx_dma(&tfm->base);
}
static inline void kpp_request_complete(struct kpp_request *req, int err)
{
crypto_request_complete(&req->base, err);
}
static inline const char *kpp_alg_name(struct crypto_kpp *tfm)
{
return crypto_kpp_tfm(tfm)->__crt_alg->cra_name;
}
/*
* Template instance internal helpers.
*/
/**
* kpp_crypto_instance() - Cast a &struct kpp_instance to the corresponding
* generic &struct crypto_instance.
* @inst: Pointer to the &struct kpp_instance to be cast.
* Return: A pointer to the &struct crypto_instance embedded in @inst.
*/
static inline struct crypto_instance *kpp_crypto_instance(
struct kpp_instance *inst)
{
return &inst->s.base;
}
Annotation
- Immediate include surface: `crypto/kpp.h`, `crypto/algapi.h`.
- Detected declarations: `struct kpp_instance`, `struct crypto_kpp_spawn`, `function kpp_set_reqsize`, `function kpp_set_reqsize_dma`, `function kpp_request_complete`, `function kpp_crypto_instance`, `function kpp_instance`, `function kpp_alg_instance`, `function kpp_instance_ctx`, `function crypto_drop_kpp`.
- 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.