summaryrefslogtreecommitdiffstats
path: root/crypto/include
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-02-28 14:59:44 +0000
committerMatt Caswell <matt@openssl.org>2018-03-02 10:14:31 +0000
commit13735cfef69dfac2d36229810ea0400e2bc6526d (patch)
tree1f4b01e1f1eeb5a1876141515fc82ec043ca9042 /crypto/include
parentf7869f1be610aaec85f25351a50b52e8130a2421 (diff)
Integrate X448 and Ed448 into libcrypto
This adds all of the relevant EVP plumbing required to make X448 and Ed448 work. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/5481)
Diffstat (limited to 'crypto/include')
-rw-r--r--crypto/include/internal/asn1_int.h2
-rw-r--r--crypto/include/internal/evp_int.h18
2 files changed, 20 insertions, 0 deletions
diff --git a/crypto/include/internal/asn1_int.h b/crypto/include/internal/asn1_int.h
index 90d525aa8d..664d4d69cb 100644
--- a/crypto/include/internal/asn1_int.h
+++ b/crypto/include/internal/asn1_int.h
@@ -68,7 +68,9 @@ extern const EVP_PKEY_ASN1_METHOD dhx_asn1_meth;
extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meths[5];
extern const EVP_PKEY_ASN1_METHOD eckey_asn1_meth;
extern const EVP_PKEY_ASN1_METHOD ecx25519_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD ecx448_asn1_meth;
extern const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth;
+extern const EVP_PKEY_ASN1_METHOD ed448_asn1_meth;
extern const EVP_PKEY_ASN1_METHOD poly1305_asn1_meth;
extern const EVP_PKEY_ASN1_METHOD hmac_asn1_meth;
diff --git a/crypto/include/internal/evp_int.h b/crypto/include/internal/evp_int.h
index a838a2a319..77c8731355 100644
--- a/crypto/include/internal/evp_int.h
+++ b/crypto/include/internal/evp_int.h
@@ -90,7 +90,9 @@ extern const EVP_PKEY_METHOD dhx_pkey_meth;
extern const EVP_PKEY_METHOD dsa_pkey_meth;
extern const EVP_PKEY_METHOD ec_pkey_meth;
extern const EVP_PKEY_METHOD ecx25519_pkey_meth;
+extern const EVP_PKEY_METHOD ecx448_pkey_meth;
extern const EVP_PKEY_METHOD ed25519_pkey_meth;
+extern const EVP_PKEY_METHOD ed448_pkey_meth;
extern const EVP_PKEY_METHOD hmac_pkey_meth;
extern const EVP_PKEY_METHOD rsa_pkey_meth;
extern const EVP_PKEY_METHOD rsa_pss_pkey_meth;
@@ -361,6 +363,21 @@ const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; }
cipher##_init_key, NULL, NULL, NULL, NULL)
+# ifndef OPENSSL_NO_EC
+
+#define X25519_KEYLEN 32
+#define X448_KEYLEN 56
+#define ED448_KEYLEN 57
+
+#define MAX_KEYLEN ED448_KEYLEN
+
+typedef struct {
+ unsigned char pubkey[MAX_KEYLEN];
+ unsigned char *privkey;
+} ECX_KEY;
+
+#endif
+
/*
* Type needs to be a bit field Sub-type needs to be for variations on the
* method, as in, can it do arbitrary encryption....
@@ -385,6 +402,7 @@ struct evp_pkey_st {
# endif
# ifndef OPENSSL_NO_EC
struct ec_key_st *ec; /* ECC */
+ ECX_KEY *ecx; /* X25519, X448, Ed25519, Ed448 */
# endif
} pkey;
int save_parameters;