diff options
Diffstat (limited to 'src/lib/libcrypto/man/ECDH_compute_key.3')
-rw-r--r-- | src/lib/libcrypto/man/ECDH_compute_key.3 | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/ECDH_compute_key.3 b/src/lib/libcrypto/man/ECDH_compute_key.3 new file mode 100644 index 0000000000..973ce4289c --- /dev/null +++ b/src/lib/libcrypto/man/ECDH_compute_key.3 | |||
@@ -0,0 +1,88 @@ | |||
1 | .\" $OpenBSD: ECDH_compute_key.3,v 1.1 2019/08/19 13:08:26 schwarze Exp $ | ||
2 | .\" Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org> | ||
3 | .\" | ||
4 | .\" Permission to use, copy, modify, and distribute this software for any | ||
5 | .\" purpose with or without fee is hereby granted, provided that the above | ||
6 | .\" copyright notice and this permission notice appear in all copies. | ||
7 | .\" | ||
8 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
9 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
10 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
11 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
12 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
13 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
14 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
15 | .\" | ||
16 | .Dd $Mdocdate: August 19 2019 $ | ||
17 | .Dt ECDH_COMPUTE_KEY 3 | ||
18 | .Os | ||
19 | .Sh NAME | ||
20 | .Nm ECDH_compute_key , | ||
21 | .Nm ECDH_size | ||
22 | .Nd Elliptic Curve Diffie-Hellman key exchange | ||
23 | .Sh SYNOPSIS | ||
24 | .In openssl/ecdh.h | ||
25 | .Ft int | ||
26 | .Fo ECDH_compute_key | ||
27 | .Fa "void *out" | ||
28 | .Fa "size_t outlen" | ||
29 | .Fa "const EC_POINT *public_key" | ||
30 | .Fa "EC_KEY *ecdh" | ||
31 | .Fa "void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen)" | ||
32 | .Fc | ||
33 | .Ft int | ||
34 | .Fo ECDH_size | ||
35 | .Fa "const EC_KEY *ecdh" | ||
36 | .Fc | ||
37 | .Sh DESCRIPTION | ||
38 | .Fn ECDH_compute_key | ||
39 | performs Elliptic Curve Diffie-Hellman key agreement. | ||
40 | It combines the private key contained in | ||
41 | .Fa ecdh | ||
42 | with the other party's | ||
43 | .Fa public_key , | ||
44 | takes the | ||
45 | .Fa x | ||
46 | component of the affine coordinates, | ||
47 | and optionally applies the key derivation function | ||
48 | .Fa KDF . | ||
49 | It stores the resulting symmetric key in the buffer | ||
50 | .Fa out , | ||
51 | which is | ||
52 | .Fa outlen | ||
53 | bytes long. | ||
54 | If | ||
55 | .Fa KDF | ||
56 | is | ||
57 | .Dv NULL , | ||
58 | .Fa outlen | ||
59 | must be at least | ||
60 | .Fn ECDH_size ecdh . | ||
61 | .Pp | ||
62 | .Fn ECDH_size | ||
63 | returns the number of bytes needed to store an affine coordinate of a | ||
64 | point on the elliptic curve used by | ||
65 | .Fa ecdh , | ||
66 | which is one eigth of the degree of the finite field underlying | ||
67 | that elliptic curve, rounded up to the next integer number. | ||
68 | .Sh RETURN VALUES | ||
69 | .Fn ECDH_compute_key | ||
70 | returns the length of the computed key in bytes or -1 if an error occurs. | ||
71 | .Pp | ||
72 | .Fn ECDH_size | ||
73 | returns the number of bytes needed to store an affine coordinate. | ||
74 | .Sh SEE ALSO | ||
75 | .Xr DH_generate_key 3 , | ||
76 | .Xr DH_size 3 , | ||
77 | .Xr EC_GROUP_new 3 , | ||
78 | .Xr EC_KEY_new 3 , | ||
79 | .Xr EC_POINT_new 3 , | ||
80 | .Xr X25519 3 | ||
81 | .Sh HISTORY | ||
82 | .Fn ECDH_compute_key | ||
83 | first appeared in OpenSSL 0.9.8 and has been available since | ||
84 | .Ox 4.5 . | ||
85 | .Pp | ||
86 | .Fn ECDH_size | ||
87 | first appeared in | ||
88 | .Ox 6.1 . | ||