include/crypto/internal/hash.h
Source file repositories/reference/linux-study-clean/include/crypto/internal/hash.h
File Facts
- System
- Linux kernel
- Corpus path
include/crypto/internal/hash.h- Extension
.h- Size
- 11398 bytes
- Lines
- 406
- 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/algapi.hcrypto/hash.h
Detected Declarations
struct ahash_requeststruct scatterliststruct crypto_hash_walkstruct ahash_instancestruct shash_instancestruct crypto_ahash_spawnstruct crypto_shash_spawnfunction crypto_hash_walk_lastfunction crypto_shash_alg_has_setkeyfunction crypto_shash_alg_needs_keyfunction crypto_hash_alg_needs_keyfunction crypto_hash_no_export_corefunction crypto_drop_ahashfunction crypto_drop_shashfunction crypto_ahash_set_statesizefunction crypto_ahash_set_reqsizefunction crypto_ahash_testedfunction crypto_ahash_set_reqsize_dmafunction ahash_request_completefunction ahash_request_flagsfunction ahash_enqueue_requestfunction ahash_request_isvirtfunction crypto_ahash_req_virtfunction crypto_shash_coresize
Annotated Snippet
struct crypto_hash_walk {
const char *data;
unsigned int offset;
unsigned int flags;
struct page *pg;
unsigned int entrylen;
unsigned int total;
struct scatterlist *sg;
};
struct ahash_instance {
void (*free)(struct ahash_instance *inst);
union {
struct {
char head[offsetof(struct ahash_alg, halg.base)];
struct crypto_instance base;
} s;
struct ahash_alg alg;
};
};
struct shash_instance {
void (*free)(struct shash_instance *inst);
union {
struct {
char head[offsetof(struct shash_alg, base)];
struct crypto_instance base;
} s;
struct shash_alg alg;
};
};
struct crypto_ahash_spawn {
struct crypto_spawn base;
};
struct crypto_shash_spawn {
struct crypto_spawn base;
};
int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err);
int crypto_hash_walk_first(struct ahash_request *req,
struct crypto_hash_walk *walk);
static inline int crypto_hash_walk_last(struct crypto_hash_walk *walk)
{
return !(walk->entrylen | walk->total);
}
int crypto_register_ahash(struct ahash_alg *alg);
void crypto_unregister_ahash(struct ahash_alg *alg);
int crypto_register_ahashes(struct ahash_alg *algs, int count);
void crypto_unregister_ahashes(struct ahash_alg *algs, int count);
int ahash_register_instance(struct crypto_template *tmpl,
struct ahash_instance *inst);
void ahash_free_singlespawn_instance(struct ahash_instance *inst);
int shash_no_setkey(struct crypto_shash *tfm, const u8 *key,
unsigned int keylen);
static inline bool crypto_shash_alg_has_setkey(struct shash_alg *alg)
{
return alg->setkey != shash_no_setkey;
}
bool crypto_hash_alg_has_setkey(struct hash_alg_common *halg);
static inline bool crypto_shash_alg_needs_key(struct shash_alg *alg)
{
return crypto_shash_alg_has_setkey(alg) &&
!(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY);
}
static inline bool crypto_hash_alg_needs_key(struct hash_alg_common *alg)
{
return crypto_hash_alg_has_setkey(alg) &&
!(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY);
}
static inline bool crypto_hash_no_export_core(struct crypto_ahash *tfm)
{
return crypto_hash_alg_common(tfm)->base.cra_flags &
CRYPTO_AHASH_ALG_NO_EXPORT_CORE;
}
int crypto_grab_ahash(struct crypto_ahash_spawn *spawn,
struct crypto_instance *inst,
Annotation
- Immediate include surface: `crypto/algapi.h`, `crypto/hash.h`.
- Detected declarations: `struct ahash_request`, `struct scatterlist`, `struct crypto_hash_walk`, `struct ahash_instance`, `struct shash_instance`, `struct crypto_ahash_spawn`, `struct crypto_shash_spawn`, `function crypto_hash_walk_last`, `function crypto_shash_alg_has_setkey`, `function crypto_shash_alg_needs_key`.
- 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.