crypto/dh.c
Source file repositories/reference/linux-study-clean/crypto/dh.c
File Facts
- System
- Linux kernel
- Corpus path
crypto/dh.c- Extension
.c- Size
- 29652 bytes
- Lines
- 922
- 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.
- 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
linux/fips.hlinux/module.hcrypto/internal/kpp.hcrypto/kpp.hcrypto/dh.hcrypto/rng.hlinux/mpi.h
Detected Declarations
struct dh_ctxstruct dh_safe_primestruct dh_safe_prime_instance_ctxstruct dh_safe_prime_tfm_ctxfunction dh_clear_ctxfunction _compute_valfunction dh_check_params_lengthfunction dh_set_paramsfunction dh_set_secretfunction dh_is_pubkey_validfunction dh_compute_valuefunction dh_max_sizefunction dh_exit_tfmfunction dh_safe_prime_free_instancefunction dh_safe_prime_init_tfmfunction dh_safe_prime_exit_tfmfunction __add_u64_to_befunction dh_safe_prime_set_secretfunction dh_safe_prime_complete_reqfunction dh_safe_prime_generate_public_keyfunction dh_safe_prime_compute_shared_secretfunction dh_safe_prime_max_sizefunction __dh_safe_prime_createfunction dh_ffdhe2048_createfunction dh_ffdhe3072_createfunction dh_ffdhe4096_createfunction dh_ffdhe6144_createfunction dh_ffdhe8192_createfunction dh_initfunction dh_exitmodule init dh_init
Annotated Snippet
module_init(dh_init);
module_exit(dh_exit);
MODULE_ALIAS_CRYPTO("dh");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("DH generic algorithm");
Annotation
- Immediate include surface: `linux/fips.h`, `linux/module.h`, `crypto/internal/kpp.h`, `crypto/kpp.h`, `crypto/dh.h`, `crypto/rng.h`, `linux/mpi.h`.
- Detected declarations: `struct dh_ctx`, `struct dh_safe_prime`, `struct dh_safe_prime_instance_ctx`, `struct dh_safe_prime_tfm_ctx`, `function dh_clear_ctx`, `function _compute_val`, `function dh_check_params_length`, `function dh_set_params`, `function dh_set_secret`, `function dh_is_pubkey_valid`.
- Atlas domain: Kernel Services / crypto.
- Implementation status: integration 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.