summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp')
-rw-r--r--src/lib/libcrypto/evp/evp.h11
-rw-r--r--src/lib/libcrypto/evp/evp_locl.h12
-rw-r--r--src/lib/libcrypto/evp/pmeth_lib.c6
3 files changed, 26 insertions, 3 deletions
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h
index f4702ab433..f8bab26b3f 100644
--- a/src/lib/libcrypto/evp/evp.h
+++ b/src/lib/libcrypto/evp/evp.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp.h,v 1.110 2022/11/10 15:17:30 jsing Exp $ */ 1/* $OpenBSD: evp.h,v 1.111 2022/11/10 16:37:52 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -115,6 +115,10 @@
115#define EVP_PKEY_HKDF NID_hkdf 115#define EVP_PKEY_HKDF NID_hkdf
116#define EVP_PKEY_GOSTR12_256 NID_id_tc26_gost3410_2012_256 116#define EVP_PKEY_GOSTR12_256 NID_id_tc26_gost3410_2012_256
117#define EVP_PKEY_GOSTR12_512 NID_id_tc26_gost3410_2012_512 117#define EVP_PKEY_GOSTR12_512 NID_id_tc26_gost3410_2012_512
118#if defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL)
119#define EVP_PKEY_ED25519 NID_ED25519
120#define EVP_PKEY_X25519 NID_X25519
121#endif
118 122
119#ifdef __cplusplus 123#ifdef __cplusplus
120extern "C" { 124extern "C" {
@@ -297,6 +301,11 @@ extern "C" {
297/* Length of tag for TLS */ 301/* Length of tag for TLS */
298#define EVP_CHACHAPOLY_TLS_TAG_LEN 16 302#define EVP_CHACHAPOLY_TLS_TAG_LEN 16
299 303
304#if defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL)
305#define ED25519_KEYLEN 32
306#define X25519_KEYLEN 32
307#endif
308
300typedef struct evp_cipher_info_st { 309typedef struct evp_cipher_info_st {
301 const EVP_CIPHER *cipher; 310 const EVP_CIPHER *cipher;
302 unsigned char iv[EVP_MAX_IV_LENGTH]; 311 unsigned char iv[EVP_MAX_IV_LENGTH];
diff --git a/src/lib/libcrypto/evp/evp_locl.h b/src/lib/libcrypto/evp/evp_locl.h
index dd7d2522e6..37fc55eb9c 100644
--- a/src/lib/libcrypto/evp/evp_locl.h
+++ b/src/lib/libcrypto/evp/evp_locl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_locl.h,v 1.29 2022/11/10 15:17:30 jsing Exp $ */ 1/* $OpenBSD: evp_locl.h,v 1.30 2022/11/10 16:37:52 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -74,6 +74,15 @@ typedef int evp_verify_method(int type, const unsigned char *m,
74 unsigned int m_length, const unsigned char *sigbuf, unsigned int siglen, 74 unsigned int m_length, const unsigned char *sigbuf, unsigned int siglen,
75 void *key); 75 void *key);
76 76
77struct ecx_key_st {
78 int nid;
79 int key_len;
80 uint8_t *priv_key;
81 size_t priv_key_len;
82 uint8_t *pub_key;
83 size_t pub_key_len;
84};
85
77/* Type needs to be a bit field 86/* Type needs to be a bit field
78 * Sub-type needs to be for variations on the method, as in, can it do 87 * Sub-type needs to be for variations on the method, as in, can it do
79 * arbitrary encryption.... */ 88 * arbitrary encryption.... */
@@ -96,6 +105,7 @@ struct evp_pkey_st {
96#endif 105#endif
97#ifndef OPENSSL_NO_EC 106#ifndef OPENSSL_NO_EC
98 struct ec_key_st *ec; /* ECC */ 107 struct ec_key_st *ec; /* ECC */
108 struct ecx_key_st *ecx; /* ECX */
99#endif 109#endif
100#ifndef OPENSSL_NO_GOST 110#ifndef OPENSSL_NO_GOST
101 struct gost_key_st *gost; /* GOST */ 111 struct gost_key_st *gost; /* GOST */
diff --git a/src/lib/libcrypto/evp/pmeth_lib.c b/src/lib/libcrypto/evp/pmeth_lib.c
index 0a0451fd92..19610dfbad 100644
--- a/src/lib/libcrypto/evp/pmeth_lib.c
+++ b/src/lib/libcrypto/evp/pmeth_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pmeth_lib.c,v 1.24 2022/11/09 18:25:36 jsing Exp $ */ 1/* $OpenBSD: pmeth_lib.c,v 1.25 2022/11/10 16:37:52 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -82,24 +82,28 @@ extern const EVP_PKEY_METHOD cmac_pkey_meth;
82extern const EVP_PKEY_METHOD dh_pkey_meth; 82extern const EVP_PKEY_METHOD dh_pkey_meth;
83extern const EVP_PKEY_METHOD dsa_pkey_meth; 83extern const EVP_PKEY_METHOD dsa_pkey_meth;
84extern const EVP_PKEY_METHOD ec_pkey_meth; 84extern const EVP_PKEY_METHOD ec_pkey_meth;
85extern const EVP_PKEY_METHOD ed25519_pkey_meth;
85extern const EVP_PKEY_METHOD gostimit_pkey_meth; 86extern const EVP_PKEY_METHOD gostimit_pkey_meth;
86extern const EVP_PKEY_METHOD gostr01_pkey_meth; 87extern const EVP_PKEY_METHOD gostr01_pkey_meth;
87extern const EVP_PKEY_METHOD hkdf_pkey_meth; 88extern const EVP_PKEY_METHOD hkdf_pkey_meth;
88extern const EVP_PKEY_METHOD hmac_pkey_meth; 89extern const EVP_PKEY_METHOD hmac_pkey_meth;
89extern const EVP_PKEY_METHOD rsa_pkey_meth; 90extern const EVP_PKEY_METHOD rsa_pkey_meth;
90extern const EVP_PKEY_METHOD rsa_pss_pkey_meth; 91extern const EVP_PKEY_METHOD rsa_pss_pkey_meth;
92extern const EVP_PKEY_METHOD x25519_pkey_meth;
91 93
92static const EVP_PKEY_METHOD *pkey_methods[] = { 94static const EVP_PKEY_METHOD *pkey_methods[] = {
93 &cmac_pkey_meth, 95 &cmac_pkey_meth,
94 &dh_pkey_meth, 96 &dh_pkey_meth,
95 &dsa_pkey_meth, 97 &dsa_pkey_meth,
96 &ec_pkey_meth, 98 &ec_pkey_meth,
99 &ed25519_pkey_meth,
97 &gostimit_pkey_meth, 100 &gostimit_pkey_meth,
98 &gostr01_pkey_meth, 101 &gostr01_pkey_meth,
99 &hkdf_pkey_meth, 102 &hkdf_pkey_meth,
100 &hmac_pkey_meth, 103 &hmac_pkey_meth,
101 &rsa_pkey_meth, 104 &rsa_pkey_meth,
102 &rsa_pss_pkey_meth, 105 &rsa_pss_pkey_meth,
106 &x25519_pkey_meth,
103}; 107};
104 108
105static const size_t pkey_methods_count = 109static const size_t pkey_methods_count =