xref: /freebsd/crypto/openssl/doc/man7/EVP_KEM-X25519.pod (revision e7be843b4a162e68651d3911f0357ed464915629)
1=pod
2
3=head1 NAME
4
5EVP_KEM-X25519, EVP_KEM-X448
6- EVP_KEM X25519 and EVP_KEM X448 keytype and algorithm support
7
8=head1 DESCRIPTION
9
10The B<X25519> and <X448> keytype and its parameters are described in
11L<EVP_PKEY-X25519(7)>.
12See L<EVP_PKEY_encapsulate(3)> and L<EVP_PKEY_decapsulate(3)> for more info.
13
14=head2 X25519 and X448 KEM parameters
15
16=over 4
17
18=item "operation" (B<OSSL_KEM_PARAM_OPERATION>)<UTF8 string>
19
20The OpenSSL X25519 and X448 Key Encapsulation Mechanisms only support the
21following default operation (operating mode):
22
23=over 4
24
25=item "DHKEM" (B<OSSL_KEM_PARAM_OPERATION_DHKEM>)
26
27The encapsulate function generates an ephemeral keypair. It produces keymaterial
28by doing an X25519 or X448 key exchange using the ephemeral private key and a
29supplied recipient public key. A HKDF operation using the keymaterial and a kem
30context then produces a shared secret. The shared secret and the ephemeral
31public key are returned.
32The decapsulate function uses the recipient private key and the
33ephemeral public key to produce the same keymaterial, which can then be used to
34produce the same shared secret.
35See L<https://www.rfc-editor.org/rfc/rfc9180.html#name-dh-based-kem-dhkem>
36
37=back
38
39This can be set using either EVP_PKEY_CTX_set_kem_op() or
40EVP_PKEY_CTX_set_params().
41
42=item "ikme" (B<OSSL_KEM_PARAM_IKME>) <octet string>
43
44Used to specify the key material used for generation of the ephemeral key.
45This value should not be reused for other purposes.
46It should have a length of at least 32 for X25519, and 56 for X448.
47If this value is not set, then a random ikm is used.
48
49=back
50
51=head1 CONFORMING TO
52
53=over 4
54
55=item RFC9180
56
57=back
58
59=head1 SEE ALSO
60
61L<EVP_PKEY_CTX_set_kem_op(3)>,
62L<EVP_PKEY_encapsulate(3)>,
63L<EVP_PKEY_decapsulate(3)>
64L<EVP_KEYMGMT(3)>,
65L<EVP_PKEY(3)>,
66L<provider-keymgmt(7)>
67
68=head1 HISTORY
69
70This functionality was added in OpenSSL 3.2.
71
72The C<operation> (operating mode) was a required parameter prior to OpenSSL 3.5.
73As of OpenSSL 3.5, C<DHKEM> is the default operating mode, and no explicit value
74need be specified.
75
76=head1 COPYRIGHT
77
78Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
79
80Licensed under the Apache License 2.0 (the "License").  You may not use
81this file except in compliance with the License.  You can obtain a copy
82in the file LICENSE in the source distribution or at
83L<https://www.openssl.org/source/license.html>.
84
85=cut
86