xref: /openssl/doc/man7/EVP_KEM-EC.pod (revision f5060f9b)
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 operation:
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
73=head1 COPYRIGHT
74
75Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
76
77Licensed under the Apache License 2.0 (the "License").  You may not use
78this file except in compliance with the License.  You can obtain a copy
79in the file LICENSE in the source distribution or at
80L<https://www.openssl.org/source/license.html>.
81
82=cut
83