include/crypto/mldsa.h
Source file repositories/reference/linux-study-clean/include/crypto/mldsa.h
File Facts
- System
- Linux kernel
- Corpus path
include/crypto/mldsa.h- Extension
.h- Size
- 2095 bytes
- Lines
- 63
- 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.h
Detected Declarations
enum mldsa_alg
Annotated Snippet
#ifndef _CRYPTO_MLDSA_H
#define _CRYPTO_MLDSA_H
#include <linux/types.h>
/* Identifier for an ML-DSA parameter set */
enum mldsa_alg {
MLDSA44, /* ML-DSA-44 */
MLDSA65, /* ML-DSA-65 */
MLDSA87, /* ML-DSA-87 */
};
/* Lengths of ML-DSA public keys and signatures in bytes */
#define MLDSA44_PUBLIC_KEY_SIZE 1312
#define MLDSA65_PUBLIC_KEY_SIZE 1952
#define MLDSA87_PUBLIC_KEY_SIZE 2592
#define MLDSA44_SIGNATURE_SIZE 2420
#define MLDSA65_SIGNATURE_SIZE 3309
#define MLDSA87_SIGNATURE_SIZE 4627
/**
* mldsa_verify() - Verify an ML-DSA signature
* @alg: The ML-DSA parameter set to use
* @sig: The signature
* @sig_len: Length of the signature in bytes. Should match the
* MLDSA*_SIGNATURE_SIZE constant associated with @alg,
* otherwise -EBADMSG will be returned.
* @msg: The message
* @msg_len: Length of the message in bytes
* @pk: The public key
* @pk_len: Length of the public key in bytes. Should match the
* MLDSA*_PUBLIC_KEY_SIZE constant associated with @alg,
* otherwise -EBADMSG will be returned.
*
* This verifies a signature using pure ML-DSA with the specified parameter set.
* The context string is assumed to be empty. This corresponds to FIPS 204
* Algorithm 3 "ML-DSA.Verify" with the ctx parameter set to the empty string
* and the lengths of the signature and key given explicitly by the caller.
*
* Context: Might sleep
*
* Return:
* * 0 if the signature is valid
* * -EBADMSG if the signature and/or public key is malformed
* * -EKEYREJECTED if the signature is invalid but otherwise well-formed
* * -ENOMEM if out of memory so the validity of the signature is unknown
*/
int mldsa_verify(enum mldsa_alg alg, const u8 *sig, size_t sig_len,
const u8 *msg, size_t msg_len, const u8 *pk, size_t pk_len);
#if IS_ENABLED(CONFIG_CRYPTO_LIB_MLDSA_KUNIT_TEST)
/* Internal function, exposed only for unit testing */
s32 mldsa_use_hint(u8 h, s32 r, s32 gamma2);
#endif
#endif /* _CRYPTO_MLDSA_H */
Annotation
- Immediate include surface: `linux/types.h`.
- Detected declarations: `enum mldsa_alg`.
- 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.