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_SIGNATURE-SLH-DSA 7ossl"
way too many mistakes in technical documents.
The different algorithms names correspond to the parameter sets defined in FIPS 205 Section 11 Table 2. \f(CW\*(C`s\*(C' types have smaller signature sizes, and the \*(C`f\*(C' variants are faster, (The signatures range from ~8K to ~50K depending on the type chosen). There are 3 different security categories also depending on the type.
\fBEVP_SIGNATURE_fetch\|(3) can be used to explicitely fetch one of the 12 algorithms which can then be used with EVP_PKEY_sign_message_init\|(3), \fBEVP_PKEY_sign\|(3), EVP_PKEY_verify_message_init\|(3), and \fBEVP_PKEY_verify\|(3) to perform one-shot message signing or verification.
The normal signing process (called Pure SLH-DSA Signature Generation) encodes the message internally as 0x00 || len(ctx) || ctx || message. where ctx is some optional value of size 0x00..0xFF. OpenSSL also allows the message to not be encoded which is required for testing. OpenSSL does not support Pre Hash SLH-DSA Signature Generation, but this may be done by the user by doing Pre hash encoding externally and then chosing the option to not encode the message.
The following parameters can be used when signing: They can be set by passing an OSSL_PARAM array to EVP_PKEY_sign_init_ex2\|(3).
See EVP_PKEY-SLH-DSA\|(7) for information related to SLH-DSA keys.
.Vb 10 void do_sign(EVP_PKEY *key, unsigned char *msg, size_t msg_len) { size_t sig_len; unsigned char *sig = NULL; const OSSL_PARAM params[] = { OSSL_PARAM_octet_string("context-string", (unsigned char *)"A context string", 33), OSSL_PARAM_END }; EVP_PKEY_CTX *sctx = EVP_PKEY_CTX_new_from_pkey(NULL, pkey, NULL); EVP_SIGNATURE *sig_alg = EVP_SIGNATURE_fetch(NULL, "SLH-DSA-SHA2-128s", NULL); \& EVP_PKEY_sign_message_init(sctx, sig_alg, params); /* Calculate the required size for the signature by passing a NULL buffer. */ EVP_PKEY_sign(sctx, NULL, &sig_len, msg, msg_len); sig = OPENSSL_zalloc(sig_len); EVP_PKEY_sign(sctx, sig, &sig_len, msg, msg_len); ... OPENSSL_free(sig); EVP_SIGNATURE(sig_alg); EVP_PKEY_CTX_free(sctx); } .Ve
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>.