include/crypto/md5.h
Source file repositories/reference/linux-study-clean/include/crypto/md5.h
File Facts
- System
- Linux kernel
- Corpus path
include/crypto/md5.h- Extension
.h- Size
- 5917 bytes
- Lines
- 211
- 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/hash.hlinux/types.h
Detected Declarations
struct md5_statestruct md5_block_statestruct md5_ctxstruct hmac_md5_keystruct hmac_md5_ctxfunction hmac_md5_update
Annotated Snippet
struct md5_state {
u32 hash[MD5_HASH_WORDS];
u64 byte_count;
u32 block[MD5_BLOCK_WORDS];
};
/* State for the MD5 compression function */
struct md5_block_state {
u32 h[MD5_HASH_WORDS];
};
/**
* struct md5_ctx - Context for hashing a message with MD5
* @state: the compression function state
* @bytecount: number of bytes processed so far
* @buf: partial block buffer; bytecount % MD5_BLOCK_SIZE bytes are valid
*/
struct md5_ctx {
struct md5_block_state state;
u64 bytecount;
u8 buf[MD5_BLOCK_SIZE] __aligned(__alignof__(__le64));
};
/**
* md5_init() - Initialize an MD5 context for a new message
* @ctx: the context to initialize
*
* If you don't need incremental computation, consider md5() instead.
*
* Context: Any context.
*/
void md5_init(struct md5_ctx *ctx);
/**
* md5_update() - Update an MD5 context with message data
* @ctx: the context to update; must have been initialized
* @data: the message data
* @len: the data length in bytes
*
* This can be called any number of times.
*
* Context: Any context.
*/
void md5_update(struct md5_ctx *ctx, const u8 *data, size_t len);
/**
* md5_final() - Finish computing an MD5 message digest
* @ctx: the context to finalize; must have been initialized
* @out: (output) the resulting MD5 message digest
*
* After finishing, this zeroizes @ctx. So the caller does not need to do it.
*
* Context: Any context.
*/
void md5_final(struct md5_ctx *ctx, u8 out[at_least MD5_DIGEST_SIZE]);
/**
* md5() - Compute MD5 message digest in one shot
* @data: the message data
* @len: the data length in bytes
* @out: (output) the resulting MD5 message digest
*
* Context: Any context.
*/
void md5(const u8 *data, size_t len, u8 out[at_least MD5_DIGEST_SIZE]);
/**
* struct hmac_md5_key - Prepared key for HMAC-MD5
* @istate: private
* @ostate: private
*/
struct hmac_md5_key {
struct md5_block_state istate;
struct md5_block_state ostate;
};
/**
* struct hmac_md5_ctx - Context for computing HMAC-MD5 of a message
* @hash_ctx: private
* @ostate: private
*/
struct hmac_md5_ctx {
struct md5_ctx hash_ctx;
struct md5_block_state ostate;
};
/**
* hmac_md5_preparekey() - Prepare a key for HMAC-MD5
* @key: (output) the key structure to initialize
* @raw_key: the raw HMAC-MD5 key
Annotation
- Immediate include surface: `crypto/hash.h`, `linux/types.h`.
- Detected declarations: `struct md5_state`, `struct md5_block_state`, `struct md5_ctx`, `struct hmac_md5_key`, `struct hmac_md5_ctx`, `function hmac_md5_update`.
- 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.