Merge pull request #10372 from MarkAtwood/fix/ed448-der-const

fix: add const to wc_Ed448 DER export function key parameters
This commit is contained in:
David Garske
2026-05-05 12:49:30 -07:00
committed by GitHub
3 changed files with 12 additions and 11 deletions
+6 -5
View File
@@ -2845,7 +2845,7 @@ int wc_Ed448PublicKeyDecode(const byte* input, word32* inOutIdx,
\sa wc_Ed448PrivateKeyToDer
*/
int wc_Ed448KeyToDer(ed448_key* key, byte* output, word32 inLen);
int wc_Ed448KeyToDer(const ed448_key* key, byte* output, word32 inLen);
/*!
\ingroup Ed448
@@ -2868,7 +2868,7 @@ int wc_Ed448KeyToDer(ed448_key* key, byte* output, word32 inLen);
\sa wc_Ed448PrivateKeyDecode
*/
int wc_Ed448PrivateKeyToDer(ed448_key* key, byte* output,
int wc_Ed448PrivateKeyToDer(const ed448_key* key, byte* output,
word32 inLen);
/*!
@@ -2881,19 +2881,20 @@ int wc_Ed448PrivateKeyToDer(ed448_key* key, byte* output,
\param key Ed448 key structure with public key
\param output Buffer for DER encoded public key
\param inLen Size of output buffer
\param withAlg 1 to include algorithm identifier, 0 for key data only
_Example_
\code
ed448_key key;
byte der[1024];
int derSz = wc_Ed448PublicKeyToDer(&key, der,
sizeof(der));
sizeof(der), 1);
\endcode
\sa wc_Ed448PublicKeyDecode
*/
int wc_Ed448PublicKeyToDer(ed448_key* key, byte* output,
int inLen);
int wc_Ed448PublicKeyToDer(const ed448_key* key, byte* output,
word32 inLen, int withAlg);
/*!
\ingroup Curve448
+3 -3
View File
@@ -12920,7 +12920,7 @@ int wc_Ed25519PublicKeyToDer(const ed25519_key* key, byte* output, word32 inLen,
* @return BAD_FUNC_ARG when key is NULL.
* @return MEMORY_E when dynamic memory allocation failed.
*/
int wc_Ed448PublicKeyToDer(ed448_key* key, byte* output, word32 inLen,
int wc_Ed448PublicKeyToDer(const ed448_key* key, byte* output, word32 inLen,
int withAlg)
{
int ret;
@@ -32368,7 +32368,7 @@ int wc_Curve448PublicKeyDecode(const byte* input, word32* inOutIdx,
#if defined(HAVE_ED448) && defined(HAVE_ED448_KEY_EXPORT)
/* Write a Private ecc key, including public to DER format,
* length on success else < 0 */
int wc_Ed448KeyToDer(ed448_key* key, byte* output, word32 inLen)
int wc_Ed448KeyToDer(const ed448_key* key, byte* output, word32 inLen)
{
if (key == NULL) {
return BAD_FUNC_ARG;
@@ -32379,7 +32379,7 @@ int wc_Ed448KeyToDer(ed448_key* key, byte* output, word32 inLen)
/* Write only private ecc key to DER format,
* length on success else < 0 */
int wc_Ed448PrivateKeyToDer(ed448_key* key, byte* output, word32 inLen)
int wc_Ed448PrivateKeyToDer(const ed448_key* key, byte* output, word32 inLen)
{
if (key == NULL) {
return BAD_FUNC_ARG;
+3 -3
View File
@@ -857,11 +857,11 @@ WOLFSSL_API int wc_Ed448PublicKeyDecode(
const byte* input, word32* inOutIdx, ed448_key* key, word32 inSz);
#endif
#ifdef HAVE_ED448_KEY_EXPORT
WOLFSSL_API int wc_Ed448KeyToDer(ed448_key* key, byte* output, word32 inLen);
WOLFSSL_API int wc_Ed448KeyToDer(const ed448_key* key, byte* output, word32 inLen);
WOLFSSL_API int wc_Ed448PrivateKeyToDer(
ed448_key* key, byte* output, word32 inLen);
const ed448_key* key, byte* output, word32 inLen);
WOLFSSL_API int wc_Ed448PublicKeyToDer(
ed448_key* key, byte* output, word32 inLen, int withAlg);
const ed448_key* key, byte* output, word32 inLen, int withAlg);
#endif
#endif /* HAVE_ED448 */