mirror of https://github.com/openssl/openssl.git
124 lines
3.7 KiB
Plaintext
124 lines
3.7 KiB
Plaintext
=pod
|
|
|
|
=head1 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
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
The B<SLH-DSA-SHA2-128s>, B<EVP_PKEY-SLH-DSA-SHA2-128f>,
|
|
B<SLH-DSA-SHA2-192s>, B<EVP_PKEY-SLH-DSA-SHA2-192f>,
|
|
B<SLH-DSA-SHA2-256s>, B<EVP_PKEY-SLH-DSA-SHA2-256f>,
|
|
B<SLH-DSA-SHAKE-128s>, B<EVP_PKEY-SLH-DSA-SHAKE-128f>,
|
|
B<SLH-DSA-SHAKE-192s>, B<EVP_PKEY-SLH-DSA-SHAKE-192f>,
|
|
B<SLH-DSA-SHAKE-256s> and B<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 I<pub> and the
|
|
private key I<priv>.
|
|
|
|
Each of the different key types has an associated security parameter B<n>.
|
|
This value is one of 16, 24 or 32 for key types B<SLH-DSA*128*>, B<SLH-DSA*192*>
|
|
and B<SLH-DSA*256*>, respectively.
|
|
|
|
Both the public and private key contain 2 elements of size B<n>.
|
|
Key generation generates the private key elements and one of the public key
|
|
elements randomly, the final public key element is computed from these values.
|
|
|
|
=head2 Keygen Parameters
|
|
|
|
=over 4
|
|
|
|
=item "seed" (B<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 * B<n>.
|
|
|
|
=item "properties" (B<OSSL_PKEY_PARAM_PROPERTIES>) <utf8_string>
|
|
|
|
Sets properties to be used when fetching algorithm implementations used for
|
|
SLH-DSA hashing operations.
|
|
|
|
=back
|
|
|
|
Use EVP_PKEY_CTX_set_params() after calling EVP_PKEY_keygen_init().
|
|
|
|
=head2 Common SLH-DSA parameters
|
|
|
|
In addition to the common parameters that all keytypes should support (see
|
|
L<provider-keymgmt(7)/Common Information Parameters>), 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().
|
|
|
|
=over 4
|
|
|
|
=item "pub" (B<OSSL_PKEY_PARAM_PUB_KEY>) <octet string>
|
|
|
|
The public key value of size 2 * B<n>
|
|
|
|
=item "priv" (B<OSSL_PKEY_PARAM_PRIV_KEY>) <octet string>
|
|
|
|
The private key value of size 2 * B<n>.
|
|
|
|
=back
|
|
|
|
=head1 CONFORMING TO
|
|
|
|
=over 4
|
|
|
|
=item FIPS 205
|
|
|
|
=back
|
|
|
|
=head1 EXAMPLES
|
|
|
|
An B<EVP_PKEY> context can be obtained by calling:
|
|
|
|
EVP_PKEY_CTX *pctx =
|
|
EVP_PKEY_CTX_new_from_name(NULL, "SLH-DSA-SHA2-128s", NULL);
|
|
|
|
An B<SLH-DSA> key can be generated like this:
|
|
|
|
pkey = EVP_PKEY_Q_keygen(NULL, NULL, "SLH-DSA-SHA2-128s");
|
|
|
|
The key pair components can be extracted from a key by calling:
|
|
|
|
uint8_t priv[64], pub[64];
|
|
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));
|
|
|
|
Similar code can be used for the other key types such as "SLH-DSA-SHAKE-256f".
|
|
|
|
=head1 SEE ALSO
|
|
|
|
L<EVP_KEYMGMT(3)>, L<EVP_PKEY(3)>, L<provider-keymgmt(7)>,
|
|
L<EVP_SIGNATURE-SLH-DSA(7)>
|
|
|
|
=head1 HISTORY
|
|
|
|
This functionality was added in OpenSSL 3.5.
|
|
|
|
=head1 COPYRIGHT
|
|
|
|
Copyright 2024 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
|
|
L<https://www.openssl.org/source/license.html>.
|
|
|
|
=cut
|