[crypto] Add definitions and tests for the NIST P-384 elliptic curve

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-01-30 15:35:34 +00:00
parent bc5f3dbe3e
commit c85de315a6
9 changed files with 379 additions and 0 deletions

View File

@@ -198,6 +198,11 @@ struct asn1_builder_header {
ASN1_OID_INITIAL ( 1, 3 ), ASN1_OID_SINGLE ( 101 ), \
ASN1_OID_SINGLE ( 110 )
/** ASN.1 OID for secp384r1 (1.3.132.0.34) */
#define ASN1_OID_SECP384R1 \
ASN1_OID_INITIAL ( 1, 3 ), ASN1_OID_DOUBLE ( 132 ), \
ASN1_OID_SINGLE ( 0 ), ASN1_OID_SINGLE ( 34 )
/** ASN.1 OID for id-aes128-cbc (2.16.840.1.101.3.4.1.2) */
#define ASN1_OID_AES128_CBC \
ASN1_OID_INITIAL ( 2, 16 ), ASN1_OID_DOUBLE ( 840 ), \

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

@@ -0,0 +1,19 @@
#ifndef _IPXE_P384_H
#define _IPXE_P384_H
/** @file
*
* NIST P-384 elliptic curve
*
*/
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <ipxe/weierstrass.h>
/** P-384 value length */
#define P384_LEN ( 384 / 8 )
extern struct elliptic_curve p384_curve;
#endif /* _IPXE_P384_H */

View File

@@ -128,6 +128,7 @@ struct tls_header {
/* TLS named curve extension */
#define TLS_NAMED_CURVE 10
#define TLS_NAMED_CURVE_SECP256R1 23
#define TLS_NAMED_CURVE_SECP384R1 24
#define TLS_NAMED_CURVE_X25519 29
/* TLS signature algorithms extension */