Update some documentation for X448/Ed448
[openssl.git] / doc / man7 / X25519.pod
1 =pod
2
3 =head1 NAME
4
5 X25519,
6 X448
7 - EVP_PKEY X25519 and X448 support
8
9 =head1 DESCRIPTION
10
11 The B<X25519> and B<X448> EVP_PKEY implementation supports key generation and
12 key derivation using B<X25519> and B<X448>. It has associated private and public
13 key formats compatible with draft-ietf-curdle-pkix-03.
14
15 No additional parameters can be set during key generation.
16
17 The peer public key must be set using EVP_PKEY_derive_set_peer() when
18 performing key derivation.
19
20 =head1 NOTES
21
22 A context for the B<X25519> algorithm can be obtained by calling:
23
24  EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X25519, NULL);
25
26 For the B<X448> algorithm a context can be obtained by calling:
27
28  EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X448, NULL);
29
30 =head1 EXAMPLE
31
32 This example generates an B<X25519> private key and writes it to standard
33 output in PEM format:
34
35  #include <openssl/evp.h>
36  #include <openssl/pem.h>
37  ...
38  EVP_PKEY *pkey = NULL;
39  EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X25519, NULL);
40  EVP_PKEY_keygen_init(pctx);
41  EVP_PKEY_keygen(pctx, &pkey);
42  EVP_PKEY_CTX_free(pctx);
43  PEM_write_PrivateKey(stdout, pkey, NULL, NULL, 0, NULL, NULL);
44
45 The key derivation example in L<EVP_PKEY_derive(3)> can be used with
46 B<X25519> and B<X448>.
47
48 =head1 SEE ALSO
49
50 L<EVP_PKEY_CTX_new(3)>,
51 L<EVP_PKEY_keygen(3)>,
52 L<EVP_PKEY_derive(3)>,
53 L<EVP_PKEY_derive_set_peer(3)>
54
55 =head1 COPYRIGHT
56
57 Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
58
59 Licensed under the OpenSSL license (the "License").  You may not use
60 this file except in compliance with the License.  You can obtain a copy
61 in the file LICENSE in the source distribution or at
62 L<https://www.openssl.org/source/license.html>.
63
64 =cut