[crypto] Generalise elliptic curve key exchange to ecdhe_key()

Split out the portion of tls_send_client_key_exchange_ecdhe() that
actually performs the elliptic curve key exchange into a separate
function ecdhe_key().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-01-21 15:13:20 +00:00
parent cc38d7dd3e
commit df7ec31766
3 changed files with 87 additions and 9 deletions

17
src/include/ipxe/ecdhe.h Normal file
View File

@@ -0,0 +1,17 @@
#ifndef _IPXE_ECDHE_H
#define _IPXE_ECDHE_H
/** @file
*
* Elliptic Curve Ephemeral Diffie-Hellman (ECDHE) key exchange
*
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <ipxe/crypto.h>
extern int ecdhe_key ( struct elliptic_curve *curve, const void *partner,
const void *private, void *public, void *shared );
#endif /* _IPXE_ECDHE_H */