From 5da71f4c98dd0f2f9e0399f1d2807c7c08b024eb Mon Sep 17 00:00:00 2001 From: Lealem Amedie Date: Tue, 28 Apr 2026 08:21:55 -0600 Subject: [PATCH] Move new wolfSSL_ED* API's to openssl/ed*.h headers --- wolfssl/openssl/ed25519.h | 14 ++++++++++++++ wolfssl/openssl/ed448.h | 14 ++++++++++++++ wolfssl/wolfcrypt/ed25519.h | 7 ------- wolfssl/wolfcrypt/ed448.h | 7 ------- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/wolfssl/openssl/ed25519.h b/wolfssl/openssl/ed25519.h index d38248fbaf..1c95e71eec 100644 --- a/wolfssl/openssl/ed25519.h +++ b/wolfssl/openssl/ed25519.h @@ -42,6 +42,20 @@ int wolfSSL_ED25519_verify(const unsigned char *msg, unsigned int msgSz, const unsigned char *pub, unsigned int pubSz, const unsigned char *sig, unsigned int sigSz); +#if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL) +#ifndef WC_ED25519KEY_TYPE_DEFINED + typedef struct ed25519_key ed25519_key; + #define WC_ED25519KEY_TYPE_DEFINED +#endif +/* Not OpenSSL API's, but these two constructors are leveraged within + * wolfSSL's compat layer for Ed25519 object creation/deletion simplicity */ +WOLFSSL_API +ed25519_key* wolfSSL_ED25519_new(void* heap, int devId); + +WOLFSSL_API +void wolfSSL_ED25519_free(ed25519_key* key); +#endif + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/wolfssl/openssl/ed448.h b/wolfssl/openssl/ed448.h index cc2ece4206..99a57d6a0b 100644 --- a/wolfssl/openssl/ed448.h +++ b/wolfssl/openssl/ed448.h @@ -42,6 +42,20 @@ int wolfSSL_ED448_verify(const unsigned char *msg, unsigned int msgSz, const unsigned char *pub, unsigned int pubSz, const unsigned char *sig, unsigned int sigSz); +#if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL) +#ifndef WC_ED448KEY_TYPE_DEFINED + typedef struct ed448_key ed448_key; + #define WC_ED448KEY_TYPE_DEFINED +#endif +/* Not OpenSSL API's, but these two constructors are leveraged within + * wolfSSL's compat layer for Ed448 object creation/deletion simplicity */ +WOLFSSL_API +ed448_key* wolfSSL_ED448_new(void* heap, int devId); + +WOLFSSL_API +void wolfSSL_ED448_free(ed448_key* key); +#endif + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/wolfssl/wolfcrypt/ed25519.h b/wolfssl/wolfcrypt/ed25519.h index 02858cc227..120c210a92 100644 --- a/wolfssl/wolfcrypt/ed25519.h +++ b/wolfssl/wolfcrypt/ed25519.h @@ -188,13 +188,6 @@ WOLFSSL_API int wc_ed25519_delete(ed25519_key* key, ed25519_key** key_p); #endif -#if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL) -WOLFSSL_API -ed25519_key* wolfSSL_ED25519_new(void* heap, int devId); -WOLFSSL_API -void wolfSSL_ED25519_free(ed25519_key* key); -#endif - #ifdef HAVE_ED25519_KEY_IMPORT WOLFSSL_API int wc_ed25519_import_public(const byte* in, word32 inLen, ed25519_key* key); diff --git a/wolfssl/wolfcrypt/ed448.h b/wolfssl/wolfcrypt/ed448.h index 44397b70e3..0890198874 100644 --- a/wolfssl/wolfcrypt/ed448.h +++ b/wolfssl/wolfcrypt/ed448.h @@ -170,13 +170,6 @@ WOLFSSL_API int wc_ed448_delete(ed448_key* key, ed448_key** key_p); #endif -#if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL) -WOLFSSL_API -ed448_key* wolfSSL_ED448_new(void* heap, int devId); -WOLFSSL_API -void wolfSSL_ED448_free(ed448_key* key); -#endif - #ifdef HAVE_ED448_KEY_IMPORT WOLFSSL_API int wc_ed448_import_public(const byte* in, word32 inLen, ed448_key* key);