GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
ECDH_COMPUTE_KEY(3) FreeBSD Library Functions Manual ECDH_COMPUTE_KEY(3)

ECDH_compute_key, ECDH_size
Elliptic Curve Diffie-Hellman key exchange

#include <openssl/ecdh.h>

int
ECDH_compute_key(void *out, size_t outlen, const EC_POINT *public_key, EC_KEY *ecdh, void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen));

int
ECDH_size(const EC_KEY *ecdh);

ECDH_compute_key() performs Elliptic Curve Diffie-Hellman key agreement. It combines the private key contained in ecdh with the other party's public_key, takes the x component of the affine coordinates, and optionally applies the key derivation function KDF. It stores the resulting symmetric key in the buffer out, which is outlen bytes long. If KDF is NULL, outlen must be at least ECDH_size(ecdh).

ECDH_size() returns the number of bytes needed to store an affine coordinate of a point on the elliptic curve used by ecdh, which is one eighth of the degree of the finite field underlying that elliptic curve, rounded up to the next integer number.

ECDH_compute_key() returns the length of the computed key in bytes or -1 if an error occurs.

ECDH_size() returns the number of bytes needed to store an affine coordinate.

DH_generate_key(3), DH_size(3), EC_GROUP_new(3), EC_KEY_new(3), EC_POINT_new(3), X25519(3)

ECDH_compute_key() first appeared in OpenSSL 0.9.8 and has been available since OpenBSD 4.5.

ECDH_size() first appeared in OpenBSD 6.1.

March 12, 2021 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.