EVP_PKEY-SLH-DSA(7ossl)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’œ EVP_PKEY-SLH-DSA (7ossl) β€” the OpenSSL one, bestie

okay so this is the OpenSSL manual page for the SLH-DSA keytype situation, and honestly? it's giving post-quantum excellence ✨ let's get into it.


🌸 NAME 🌸

So the whole squad of names you might see floating around is:

  • 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

…and together they're the EVP_PKEY SLH-DSA keytype + algorithm support. that's the whole vibe of this page 🫢


✨ DESCRIPTION ✨

The key types SLH-DSA-SHA2-128s, EVP_PKEY-SLH-DSA-SHA2-128f, SLH-DSA-SHA2-192s, EVP_PKEY-SLH-DSA-SHA2-192f, SLH-DSA-SHA2-256s, EVP_PKEY-SLH-DSA-SHA2-256f, SLH-DSA-SHAKE-128s, EVP_PKEY-SLH-DSA-SHAKE-128f, SLH-DSA-SHAKE-192s, EVP_PKEY-SLH-DSA-SHAKE-192f, SLH-DSA-SHAKE-256s and EVP_PKEY-SLH-DSA-SHAKE-256f are all implemented in OpenSSL's default and FIPS providers, no cap. these implementations support the associated key, which contains the public key pub and the private key priv πŸ‘‘

SLH-DSA (that's Stateless Hash-based Digital Signature Standard, say it with your chest) uses small keys, but it has relatively large signatures and is relatively slow performing all operations compared to ML-DSA. like, it's not the fastest girl in the group chat 😭 but it does have proven security proofs, because it relies only on hash functions. security girlie with receipts πŸ’…

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. math is mathing ✨

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. iconic behavior tbh 🌸

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. pick your fighter πŸ₯Š

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. big numbers, but they're our big numbers πŸ’–

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 β€” iykyk πŸ“š

πŸŽ€ Keygen Parameters πŸŽ€

  • "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> β€” 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(). order matters bestie, don't do it backwards πŸ™ˆ

πŸ¦‹ Common SLH-DSA parameters πŸ¦‹

In addition to the common parameters that all keytypes should support (peep "Common Information Parameters" in provider-keymgmt(7)), the implementation of these key types supports 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> β€” 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> β€” 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> β€” the empty string, signifying that no digest may be specified.

πŸ‘‘ CONFORMING TO πŸ‘‘

FIPS 205 β€” that's the one, periodt.


πŸ”₯ EXAMPLES πŸ”₯

An EVP_PKEY context can be obtained by calling:

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

An SLH-DSA key can be generated like this:

pkey = EVP_PKEY_Q_keygen(NULL, NULL, "SLH-DSA-SHA2-128f");

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

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));

(yeah the extra ) at the end is right there in the original, i'm just the messenger πŸ’€ copy it verbatim bestie)

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


🌈 SEE ALSO 🌈

EVP_KEYMGMT(3), EVP_PKEY(3), provider-keymgmt(7), EVP_SIGNATURE-SLH-DSA(7) β€” go read your siblings, they're iconic too πŸ’–


🧚 HISTORY 🧚

This functionality was added in OpenSSL 3.5 β€” new girl on the block, and she ate πŸ“


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>.


⭐ and that's the page!! this one came from 3.5.6, dated 2026-04-07, filed under EVP_PKEY-SLH-DSA(7ossl) β€” mwah, go forth and hash responsibly πŸŽ€πŸ’œ

πŸ“¦ where this page comes from