include/crypto/curve25519.h
Source file repositories/reference/linux-study-clean/include/crypto/curve25519.h
File Facts
- System
- Linux kernel
- Corpus path
include/crypto/curve25519.h- Extension
.h- Size
- 1123 bytes
- Lines
- 44
- 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.
Dependency Surface
linux/types.hlinux/random.h
Detected Declarations
enum curve25519_lengthsfunction curve25519_clamp_secretfunction curve25519_generate_secret
Annotated Snippet
#ifndef CURVE25519_H
#define CURVE25519_H
#include <linux/types.h>
#include <linux/random.h>
enum curve25519_lengths {
CURVE25519_KEY_SIZE = 32
};
void curve25519_generic(u8 out[at_least CURVE25519_KEY_SIZE],
const u8 scalar[at_least CURVE25519_KEY_SIZE],
const u8 point[at_least CURVE25519_KEY_SIZE]);
bool __must_check
curve25519(u8 mypublic[at_least CURVE25519_KEY_SIZE],
const u8 secret[at_least CURVE25519_KEY_SIZE],
const u8 basepoint[at_least CURVE25519_KEY_SIZE]);
bool __must_check
curve25519_generate_public(u8 pub[at_least CURVE25519_KEY_SIZE],
const u8 secret[at_least CURVE25519_KEY_SIZE]);
static inline void
curve25519_clamp_secret(u8 secret[at_least CURVE25519_KEY_SIZE])
{
secret[0] &= 248;
secret[31] = (secret[31] & 127) | 64;
}
static inline void
curve25519_generate_secret(u8 secret[at_least CURVE25519_KEY_SIZE])
{
get_random_bytes_wait(secret, CURVE25519_KEY_SIZE);
curve25519_clamp_secret(secret);
}
#endif /* CURVE25519_H */
Annotation
- Immediate include surface: `linux/types.h`, `linux/random.h`.
- Detected declarations: `enum curve25519_lengths`, `function curve25519_clamp_secret`, `function curve25519_generate_secret`.
- 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.