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