include/crypto/sm3.h
Source file repositories/reference/linux-study-clean/include/crypto/sm3.h
File Facts
- System
- Linux kernel
- Corpus path
include/crypto/sm3.h- Extension
.h- Size
- 2293 bytes
- Lines
- 88
- 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
linux/types.h
Detected Declarations
struct sm3_block_statestruct sm3_ctx
Annotated Snippet
struct sm3_block_state {
u32 h[SM3_DIGEST_SIZE / 4];
};
/**
* struct sm3_ctx - Context for hashing a message with SM3
* @state: the compression function state
* @bytecount: number of bytes processed so far
* @buf: partial block buffer; bytecount % SM3_BLOCK_SIZE bytes are valid
*/
struct sm3_ctx {
struct sm3_block_state state;
u64 bytecount;
u8 buf[SM3_BLOCK_SIZE] __aligned(__alignof__(__be64));
};
/**
* sm3_init() - Initialize an SM3 context for a new message
* @ctx: the context to initialize
*
* If you don't need incremental computation, consider sm3() instead.
*
* Context: Any context.
*/
void sm3_init(struct sm3_ctx *ctx);
/**
* sm3_update() - Update an SM3 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 sm3_update(struct sm3_ctx *ctx, const u8 *data, size_t len);
/**
* sm3_final() - Finish computing an SM3 message digest
* @ctx: the context to finalize; must have been initialized
* @out: (output) the resulting SM3 message digest
*
* After finishing, this zeroizes @ctx. So the caller does not need to do it.
*
* Context: Any context.
*/
void sm3_final(struct sm3_ctx *ctx, u8 out[at_least SM3_DIGEST_SIZE]);
/**
* sm3() - Compute SM3 message digest in one shot
* @data: the message data
* @len: the data length in bytes
* @out: (output) the resulting SM3 message digest
*
* Context: Any context.
*/
void sm3(const u8 *data, size_t len, u8 out[at_least SM3_DIGEST_SIZE]);
#endif /* _CRYPTO_SM3_H */
Annotation
- Immediate include surface: `linux/types.h`.
- Detected declarations: `struct sm3_block_state`, `struct sm3_ctx`.
- 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.