package core:crypto/mldsa

⌘K
Ctrl+K
or
/

    Types

    Parameters ¶

    Parameters :: enum int {
    	Invalid, 
    	ML_DSA_44, 
    	ML_DSA_65, 
    	ML_DSA_87, 
    }
     

    Parameters are the supported ML-DSA parameter sets.

    Related Procedures With Parameters
    Related Procedures With Returns

    Public_Key ¶

    Public_Key :: _mldsa.Public_Key
     

    Public_Key is a ML-DSA public key.

    Related Procedures With Parameters

    Constants

    MAX_CTX_SIZE ¶

    MAX_CTX_SIZE :: _mldsa.CTXBYTES_MAX
     

    MAX_CTX_SIZE is the maximum size of the signature context (domain separation tag) in bytes.

    PRIVATE_KEY_SEED_SIZE ¶

    PRIVATE_KEY_SEED_SIZE :: _mldsa.SEEDBYTES
     

    PRIVATE_KEY_SEED_SIZE is the size of a private key in bytes.

    Variables

    PUBLIC_KEY_SIZES ¶

    PUBLIC_KEY_SIZES: [Parameters]int = …
     

    PUBLIC_KEY_SIZES are the per-parameter sizes of a public key in bytes.

    SIGNATURE_SIZES ¶

    SIGNATURE_SIZES: [Parameters]int = …
     

    SIGNATURE_SIZES are the per-parameter sizes of a signature in byte.

    Procedures

    key_size ¶

    key_size :: proc(k: ^$T) -> int {…}
     

    key_size returns the key size of a Private_Key or Public_Key in bytes.

    params ¶

    params :: proc(k: ^$T) -> Parameters {…}
     

    params returns the Parameters used by a Private_Key or Public_Key instance.

    private_key_bytes ¶

    private_key_bytes :: proc(priv_key: ^_mldsa.Private_Key, dst: []u8) {…}
     

    private_key_bytes sets dst to byte-encoding of priv_key in the "seed" format.

    private_key_clear ¶

    private_key_clear :: proc "contextless" (priv_key: ^_mldsa.Private_Key) {…}
     

    private_key_clear clears priv_key to the uninitialized state.

    private_key_equal ¶

    private_key_equal :: proc(p, q: ^_mldsa.Private_Key) -> bool {…}
     

    private_key_equal returns true iff the private keys are equal, in constant time.

    private_key_generate ¶

    private_key_generate :: proc(priv_key: ^_mldsa.Private_Key, params: Parameters) -> bool {…}
     

    private_key_generate uses the system entropy source to generate a new Private_Key. This will only fail iff the system entropy source is missing or broken.

    private_key_public_bytes ¶

    private_key_public_bytes :: proc(priv_key: ^_mldsa.Private_Key, dst: []u8) {…}
     

    private_key_public_bytes sets dst to the byte-encoding of the public key corresponding to priv_key.

    private_key_set ¶

    private_key_set :: proc(priv_key, src: ^_mldsa.Private_Key) {…}
     

    private_key_set sets priv_key to src.

    private_key_set_bytes ¶

    private_key_set_bytes :: proc(priv_key: ^_mldsa.Private_Key, params: Parameters, b: []u8) -> bool {…}
     

    private_key_set_bytes decodes a byte-encoded private key in "seed" format, and returns true iff the operation was successful.

    public_key_bytes ¶

    public_key_bytes :: proc(pub_key: ^_mldsa.Public_Key, dst: []u8) {…}
     

    public_key_bytes sets dst to byte-encoding of pub_key.

    public_key_clear ¶

    public_key_clear :: proc "contextless" (pub_key: ^_mldsa.Public_Key) {…}
     

    public_key_clear clears pub_key to the uninitialized state.

    public_key_equal ¶

    public_key_equal :: proc(p, q: ^_mldsa.Public_Key) -> bool {…}
     

    public_key_equal returns true iff the public keys are equal, in constant time.

    public_key_set ¶

    public_key_set :: proc(pub_key, src: ^_mldsa.Public_Key) {…}
     

    public_key_set sets pub_key to src.

    public_key_set_bytes ¶

    public_key_set_bytes :: proc(pub_key: ^_mldsa.Public_Key, params: Parameters, b: []u8) -> bool {…}
     

    public_key_set_bytes decodes a byte-encoded public key, and returns true iff the operation was successful.

    public_key_set_priv ¶

    public_key_set_priv :: proc(pub_key: ^_mldsa.Public_Key, priv_key: ^_mldsa.Private_Key) {…}
     

    public_key_set_priv sets pub_key to the public component of priv_key.

    sign ¶

    sign :: proc(priv_key: ^_mldsa.Private_Key, ctx, msg, sig: []u8, deterministic: bool = !crypto.HAS_RAND_BYTES) -> bool {…}
     

    sign writes the signature by priv_key over (ctx, msg) to sig and returns true iff the signing succeeded.

    ctx is an optional domain separation tag and may be omitted (nil).

    signature_size ¶

    signature_size :: proc(k: ^$T) -> int {…}
     

    signature_size returns the key size of a signature in bytes.

    verify ¶

    verify :: proc(pub_key: ^_mldsa.Public_Key, ctx, msg, sig: []u8) -> bool {…}
     

    verify returns true iff sig is a valid signature by pub_key over (ctx, msg).

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2026-06 (vendor "odin") Windows_amd64 @ 2026-06-02 22:54:54.159322000 +0000 UTC