[crypto] Add Ephemeral Diffie-Hellman key exchange algorithm

Add an implementation of the Ephemeral Diffie-Hellman key exchange
algorithm as defined in RFC2631, with test vectors taken from the NIST
Cryptographic Toolkit.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2022-10-04 15:03:28 +01:00
parent 007d3cb800
commit 18b861024a
5 changed files with 936 additions and 0 deletions

19
src/include/ipxe/dhe.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef _IPXE_DHE_H
#define _IPXE_DHE_H
/** @file
*
* Ephemeral Diffie-Hellman key exchange
*
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <stdint.h>
extern int dhe_key ( const void *modulus, size_t len, const void *generator,
size_t generator_len, const void *partner,
size_t partner_len, const void *private,
size_t private_len, void *public, void *shared );
#endif /* _IPXE_DHE_H */

View File

@@ -400,6 +400,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define ERRFILE_linux_acpi ( ERRFILE_OTHER | 0x00570000 )
#define ERRFILE_dynkeymap ( ERRFILE_OTHER | 0x00580000 )
#define ERRFILE_pci_cmd ( ERRFILE_OTHER | 0x00590000 )
#define ERRFILE_dhe ( ERRFILE_OTHER | 0x005a0000 )
/** @} */