xref: /freebsd/secure/lib/libcrypto/man/man7/EVP_PKEY-SLH-DSA.7 (revision f1c4c3daccbaf3820f0e2224de53df12fc952fcc)
-*- mode: troff; coding: utf-8 -*-
Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)

Standard preamble:
========================================================================
..
..
.. \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
. ds C` "" . ds C' "" 'br\} . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF ========================================================================

Title "EVP_PKEY-SLH-DSA 7ossl"
EVP_PKEY-SLH-DSA 7ossl 2025-07-01 3.5.1 OpenSSL
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
NAME
EVP_PKEY-SLH-DSA, EVP_KEYMGMT-SLH-DSA, EVP_PKEY-SLH-DSA-SHA2-128s, EVP_PKEY-SLH-DSA-SHA2-128f, EVP_PKEY-SLH-DSA-SHA2-192s, EVP_PKEY-SLH-DSA-SHA2-192f, EVP_PKEY-SLH-DSA-SHA2-256s, EVP_PKEY-SLH-DSA-SHA2-256f, EVP_PKEY-SLH-DSA-SHAKE-128s, EVP_PKEY-SLH-DSA-SHAKE-128f, EVP_PKEY-SLH-DSA-SHAKE-192s, EVP_PKEY-SLH-DSA-SHAKE-192f, EVP_PKEY-SLH-DSA-SHAKE-256s, EVP_PKEY-SLH-DSA-SHAKE-256f \- EVP_PKEY SLH-DSA keytype and algorithm support
DESCRIPTION
Header "DESCRIPTION" The SLH-DSA-SHA2-128s, EVP_PKEY-SLH-DSA-SHA2-128f, \fBSLH-DSA-SHA2-192s, EVP_PKEY-SLH-DSA-SHA2-192f, \fBSLH-DSA-SHA2-256s, EVP_PKEY-SLH-DSA-SHA2-256f, \fBSLH-DSA-SHAKE-128s, EVP_PKEY-SLH-DSA-SHAKE-128f, \fBSLH-DSA-SHAKE-192s, EVP_PKEY-SLH-DSA-SHAKE-192f, \fBSLH-DSA-SHAKE-256s and EVP_PKEY-SLH-DSA-SHAKE-256f key types are implemented in OpenSSL's default and FIPS providers. These implementations support the associated key, containing the public key pub and the private key priv.

SLH-DSA (Stateless Hash-based Digital Signature Standard) uses small keys, but has relatively large signatures and is relatively slow performing all operations compared to ML-DSA. It does however have proven security proofs, since it relies only on hash functions.

Each of the different key types has an associated security parameter n. This value is one of 16, 24 or 32 for key types SLH-DSA*128*, SLH-DSA*192* and SLH-DSA*256*, respectively.

Both the public and private key components contain 2 elements of size n. Key generation generates the private key elements and one of the public key elements randomly, and the final public key element is computed from these values.

The public key has relatively small sizes of 32, 48 or 64 bytes, corresponding to the algorithm names of 128, 192 and 256 respectively.

The algorithms ending with s produce smaller signatures, but are much slower than the faster f variants.

The signature sizes for the s algorithm variants are 7856, 16224 and 29792 which correspond to the algorithm names of 128s, 192s and 256s respectively. The signature sizes for the f algorithm variants are 17088, 35664 and 49856 which correspond to the algorithm names containing 128f, 192f and 256f respectively.

Internally there are 7 hash related functions that are used for each algorithm. For algorithms containing SHAKE in their name SHAKE-256 is used for all functions. For the <SHA2-128> algorithms the functions use <MGF1-SHA-256>, <HMAC-SHA-256> and <SHA-256>. The remaining <SHA2> algorithms use <MGF1-SHA-512>, <HMAC-SHA-512>, <SHA-256> and <SHA-512>. See FIPS 205 Section 11.1 and 11.2 for more information.

"Keygen Parameters"
Subsection "Keygen Parameters"
"""seed"" (OSSL_PKEY_PARAM_SLH_DSA_SEED) <octet string>" 4
Item """seed"" (OSSL_PKEY_PARAM_SLH_DSA_SEED) <octet string>" Supplies values to use for the private seed, private prf and public seed instead of generating random values. This is used for testing purposes only. The length of the value supplied must be 3 * n.
"""properties"" (OSSL_PKEY_PARAM_PROPERTIES) <utf8_string>" 4
Item """properties"" (OSSL_PKEY_PARAM_PROPERTIES) <utf8_string>" Sets properties to be used when fetching algorithm implementations used for SLH-DSA hashing operations.

Use EVP_PKEY_CTX_set_params() after calling EVP_PKEY_keygen_init().

"Common SLH-DSA parameters"
Subsection "Common SLH-DSA parameters" In addition to the common parameters that all keytypes should support (see "Common Information Parameters" in provider-keymgmt\|(7)), the implementation of these key types support the following.

The following parameters are gettable using EVP_PKEY_get_octet_string_param(), and settable when using EVP_PKEY_fromdata().

"""pub"" (OSSL_PKEY_PARAM_PUB_KEY) <octet string>" 4
Item """pub"" (OSSL_PKEY_PARAM_PUB_KEY) <octet string>" The public key has a size of 2 * n bytes. i.e. It consists of the concatenation of PK.seed and PK.root as defined by FIPS 205 Figure 16.
"""priv"" (OSSL_PKEY_PARAM_PRIV_KEY) <octet string>" 4
Item """priv"" (OSSL_PKEY_PARAM_PRIV_KEY) <octet string>" The private key has a size of 4 * n bytes, which includes the public key components. i.e. It consists of the concatenation of SK.seed, SK.prf, PK.seed and PF.root as defined by FIPS 205 Figure 15.
"""mandatory-digest"" (OSSL_PKEY_PARAM_MANDATORY_DIGEST) <UTF8 string>" 4
Item """mandatory-digest"" (OSSL_PKEY_PARAM_MANDATORY_DIGEST) <UTF8 string>" The empty string, signifying that no digest may be specified.
"CONFORMING TO"
Header "CONFORMING TO"
"FIPS 205" 4
Item "FIPS 205"
EXAMPLES
Header "EXAMPLES" An EVP_PKEY context can be obtained by calling:

.Vb 2 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_from_name(NULL, "SLH-DSA-SHA2-128f", NULL); .Ve

An SLH-DSA key can be generated like this:

.Vb 1 pkey = EVP_PKEY_Q_keygen(NULL, NULL, "SLH-DSA-SHA2-128f"); .Ve

The key pair components can be extracted from a key by calling:

.Vb 2 uint8_t priv[64], pub[32]; size_t priv_len, pub_len; \& EVP_PKEY_get_octet_string_param(pkey, OSSL_PKEY_PARAM_PRIV_KEY, priv, sizeof(priv), &priv_len); EVP_PKEY_get_octet_string_param(pkey, OSSL_PKEY_PARAM_PUB_KEY, pub, sizeof(pub), &pub_len)); .Ve

Similar code can be used for the other key types such as "SLH-DSA-SHAKE-256f".

"SEE ALSO"
Header "SEE ALSO" \fBEVP_KEYMGMT\|(3), EVP_PKEY\|(3), provider-keymgmt\|(7), \fBEVP_SIGNATURE-SLH-DSA\|(7)
HISTORY
Header "HISTORY" This functionality was added in OpenSSL 3.5.
COPYRIGHT
Header "COPYRIGHT" Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.