crypto/drbg.c
Source file repositories/reference/linux-study-clean/crypto/drbg.c
File Facts
- System
- Linux kernel
- Corpus path
crypto/drbg.c- Extension
.c- Size
- 18772 bytes
- Lines
- 618
- Domain
- Kernel Services
- Bucket
- crypto
- Inferred role
- Kernel Services: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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
crypto/internal/rng.hcrypto/sha2.hlinux/fips.hlinux/kernel.hlinux/module.hlinux/mutex.hlinux/string_choices.hlinux/unaligned.h
Detected Declarations
struct drbg_statefunction drbg_hmac_updatefunction drbg_hmac_generatefunction get_random_bytesfunction drbg_seedfunction drbg_generatefunction drbg_seedfunction drbg_kcapi_initfunction drbg_kcapi_set_entropyfunction drbg_kcapi_seedfunction drbg_kcapi_generatefunction drbg_kcapi_exitfunction drbg_healthcheck_sanityfunction drbg_initfunction drbg_exitmodule init drbg_init
Annotated Snippet
module_init(drbg_init);
module_exit(drbg_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Stephan Mueller <smueller@chronox.de>");
MODULE_DESCRIPTION("NIST SP800-90A Deterministic Random Bit Generator (DRBG)");
MODULE_ALIAS_CRYPTO("stdrng");
MODULE_ALIAS_CRYPTO("drbg_nopr_hmac_sha512");
Annotation
- Immediate include surface: `crypto/internal/rng.h`, `crypto/sha2.h`, `linux/fips.h`, `linux/kernel.h`, `linux/module.h`, `linux/mutex.h`, `linux/string_choices.h`, `linux/unaligned.h`.
- Detected declarations: `struct drbg_state`, `function drbg_hmac_update`, `function drbg_hmac_generate`, `function get_random_bytes`, `function drbg_seed`, `function drbg_generate`, `function drbg_seed`, `function drbg_kcapi_init`, `function drbg_kcapi_set_entropy`, `function drbg_kcapi_seed`.
- Atlas domain: Kernel Services / crypto.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.