Merge pull request #9069 from holtrop/fix-inconsistent-prototype-parameter-names

Fix inconsistent function prototype parameter names for wolfcrypt
This commit is contained in:
Daniel Pouzzner
2025-08-08 23:28:10 -05:00
committed by GitHub
7 changed files with 45 additions and 46 deletions

View File

@@ -45,7 +45,7 @@
*/ */
int wc_PBKDF1(byte* output, const byte* passwd, int pLen, int wc_PBKDF1(byte* output, const byte* passwd, int pLen,
const byte* salt, int sLen, int iterations, int kLen, const byte* salt, int sLen, int iterations, int kLen,
int typeH); int hashType);
/*! /*!
\ingroup Password \ingroup Password
@@ -96,7 +96,7 @@ int wc_PBKDF1(byte* output, const byte* passwd, int pLen,
*/ */
int wc_PBKDF2(byte* output, const byte* passwd, int pLen, int wc_PBKDF2(byte* output, const byte* passwd, int pLen,
const byte* salt, int sLen, int iterations, int kLen, const byte* salt, int sLen, int iterations, int kLen,
int typeH); int hashType);
/*! /*!
\ingroup Password \ingroup Password
@@ -132,10 +132,10 @@ int wc_PBKDF2(byte* output, const byte* passwd, int pLen,
Should be kLen long Should be kLen long
\param passwd pointer to the buffer containing the password to use for \param passwd pointer to the buffer containing the password to use for
the key derivation the key derivation
\param pLen length of the password to use for key derivation \param passLen length of the password to use for key derivation
\param salt pointer to the buffer containing the salt to use \param salt pointer to the buffer containing the salt to use
for key derivation for key derivation
\param sLen length of the salt \param saltLen length of the salt
\param iterations number of times to process the hash \param iterations number of times to process the hash
\param kLen desired length of the derived key \param kLen desired length of the derived key
\param hashType the hashing algorithm to use. Valid choices are: WC_MD5, \param hashType the hashing algorithm to use. Valid choices are: WC_MD5,
@@ -165,6 +165,6 @@ int wc_PBKDF2(byte* output, const byte* passwd, int pLen,
\sa wc_PBKDF1 \sa wc_PBKDF1
\sa wc_PBKDF2 \sa wc_PBKDF2
*/ */
int wc_PKCS12_PBKDF(byte* output, const byte* passwd, int pLen, int wc_PKCS12_PBKDF(byte* output, const byte* passwd, int passLen,
const byte* salt, int sLen, int iterations, const byte* salt, int saltLen, int iterations,
int kLen, int typeH, int purpose); int kLen, int hashType, int id);

View File

@@ -279,17 +279,17 @@ WC_RNG* wc_rng_free(WC_RNG* rng);
\brief Creates and tests functionality of drbg. \brief Creates and tests functionality of drbg.
\return 0 on success \return 0 on success
\return BAD_FUNC_ARG entropyA and output must not be null. If reseed \return BAD_FUNC_ARG seedA and output must not be null. If reseed
set entropyB must not be null set seedB must not be null
\return -1 test failed \return -1 test failed
\param int reseed: if set, will test reseed functionality \param int reseed: if set, will test reseed functionality
\param entropyA: entropy to instantiate drgb with \param seedA: seed to instantiate drgb with
\param entropyASz: size of entropyA in bytes \param seedASz: size of seedA in bytes
\param entropyB: If reseed set, drbg will be reseeded with entropyB \param seedB: If reseed set, drbg will be reseeded with seedB
\param entropyBSz: size of entropyB in bytes \param seedBSz: size of seedB in bytes
\param output: initialized to random data seeded with entropyB if \param output: initialized to random data seeded with seedB if
seedrandom is set, and entropyA otherwise seedrandom is set, and seedA otherwise
\param outputSz: length of output in bytes \param outputSz: length of output in bytes
_Example_ _Example_
@@ -322,7 +322,6 @@ WC_RNG* wc_rng_free(WC_RNG* rng);
\sa wc_RNG_GenerateByte \sa wc_RNG_GenerateByte
\sa wc_FreeRng \sa wc_FreeRng
*/ */
int wc_RNG_HealthTest(int reseed, int wc_RNG_HealthTest(int reseed, const byte* seedA, word32 seedASz,
const byte* entropyA, word32 entropyASz, const byte* seedB, word32 seedBSz,
const byte* entropyB, word32 entropyBSz, byte* output, word32 outputSz);
byte* output, word32 outputSz);

View File

@@ -118,7 +118,7 @@ THREAD_LS_T void *StackSizeCheck_stackOffsetPointer = 0;
#ifdef DEBUG_WOLFSSL #ifdef DEBUG_WOLFSSL
/* Set these to default values initially. */ /* Set these to default values initially. */
static wolfSSL_Logging_cb log_function = NULL; static wolfSSL_Logging_cb LogFunction = NULL;
#ifndef WOLFSSL_LOGGINGENABLED_DEFAULT #ifndef WOLFSSL_LOGGINGENABLED_DEFAULT
#define WOLFSSL_LOGGINGENABLED_DEFAULT 0 #define WOLFSSL_LOGGINGENABLED_DEFAULT 0
#endif #endif
@@ -133,13 +133,13 @@ static struct log mynewt_log;
#endif /* DEBUG_WOLFSSL */ #endif /* DEBUG_WOLFSSL */
/* allow this to be set to NULL, so logs can be redirected to default output */ /* allow this to be set to NULL, so logs can be redirected to default output */
int wolfSSL_SetLoggingCb(wolfSSL_Logging_cb f) int wolfSSL_SetLoggingCb(wolfSSL_Logging_cb log_function)
{ {
#ifdef DEBUG_WOLFSSL #ifdef DEBUG_WOLFSSL
log_function = f; LogFunction = log_function;
return 0; return 0;
#else #else
(void)f; (void)log_function;
return NOT_COMPILED_IN; return NOT_COMPILED_IN;
#endif #endif
} }
@@ -148,7 +148,7 @@ int wolfSSL_SetLoggingCb(wolfSSL_Logging_cb f)
wolfSSL_Logging_cb wolfSSL_GetLoggingCb(void) wolfSSL_Logging_cb wolfSSL_GetLoggingCb(void)
{ {
#ifdef DEBUG_WOLFSSL #ifdef DEBUG_WOLFSSL
return log_function; return LogFunction;
#else #else
return NULL; return NULL;
#endif #endif
@@ -240,8 +240,8 @@ static void wolfssl_log(const int logLevel, const char* const file_name,
{ {
(void)file_name; (void)file_name;
(void)line_number; (void)line_number;
if (log_function) if (LogFunction)
log_function(logLevel, logMessage); LogFunction(logLevel, logMessage);
else { else {
#if defined(WOLFSSL_USER_LOG) #if defined(WOLFSSL_USER_LOG)
WOLFSSL_USER_LOG(logMessage); WOLFSSL_USER_LOG(logMessage);

View File

@@ -200,9 +200,9 @@ WOLFSSL_API int wc_DhCheckPubKey_ex(DhKey* key, const byte* pub, word32 pubSz,
const byte* prime, word32 primeSz); const byte* prime, word32 primeSz);
WOLFSSL_API int wc_DhCheckPubValue(const byte* prime, word32 primeSz, WOLFSSL_API int wc_DhCheckPubValue(const byte* prime, word32 primeSz,
const byte* pub, word32 pubSz); const byte* pub, word32 pubSz);
WOLFSSL_API int wc_DhCheckPrivKey(DhKey* key, const byte* priv, word32 pubSz); WOLFSSL_API int wc_DhCheckPrivKey(DhKey* key, const byte* priv, word32 privSz);
WOLFSSL_API int wc_DhCheckPrivKey_ex(DhKey* key, const byte* priv, word32 pubSz, WOLFSSL_API int wc_DhCheckPrivKey_ex(DhKey* key, const byte* priv,
const byte* prime, word32 primeSz); word32 privSz, const byte* prime, word32 primeSz);
WOLFSSL_API int wc_DhCheckKeyPair(DhKey* key, const byte* pub, word32 pubSz, WOLFSSL_API int wc_DhCheckKeyPair(DhKey* key, const byte* pub, word32 pubSz,
const byte* priv, word32 privSz); const byte* priv, word32 privSz);
WOLFSSL_API int wc_DhGenerateParams(WC_RNG *rng, int modSz, DhKey *dh); WOLFSSL_API int wc_DhGenerateParams(WC_RNG *rng, int modSz, DhKey *dh);

View File

@@ -169,11 +169,11 @@ struct Hmac {
/* does init */ /* does init */
WOLFSSL_API int wc_HmacSetKey(Hmac* hmac, int type, const byte* key, WOLFSSL_API int wc_HmacSetKey(Hmac* hmac, int type, const byte* key,
word32 keySz); word32 length);
WOLFSSL_API int wc_HmacSetKey_ex(Hmac* hmac, int type, const byte* key, WOLFSSL_API int wc_HmacSetKey_ex(Hmac* hmac, int type, const byte* key,
word32 length, int allowFlag); word32 length, int allowFlag);
WOLFSSL_API int wc_HmacUpdate(Hmac* hmac, const byte* in, word32 sz); WOLFSSL_API int wc_HmacUpdate(Hmac* hmac, const byte* msg, word32 length);
WOLFSSL_API int wc_HmacFinal(Hmac* hmac, byte* out); WOLFSSL_API int wc_HmacFinal(Hmac* hmac, byte* hash);
#ifdef WOLFSSL_KCAPI_HMAC #ifdef WOLFSSL_KCAPI_HMAC
WOLFSSL_API int wc_HmacSetKey_Software(Hmac* hmac, int type, const byte* key, WOLFSSL_API int wc_HmacSetKey_Software(Hmac* hmac, int type, const byte* key,
word32 keySz); word32 keySz);

View File

@@ -49,16 +49,16 @@ WOLFSSL_API int wc_PBKDF1_ex(byte* key, int keyLen, byte* iv, int ivLen,
int hashType, void* heap); int hashType, void* heap);
WOLFSSL_API int wc_PBKDF1(byte* output, const byte* passwd, int pLen, WOLFSSL_API int wc_PBKDF1(byte* output, const byte* passwd, int pLen,
const byte* salt, int sLen, int iterations, int kLen, const byte* salt, int sLen, int iterations, int kLen,
int typeH); int hashType);
WOLFSSL_API int wc_PBKDF2_ex(byte* output, const byte* passwd, int pLen, WOLFSSL_API int wc_PBKDF2_ex(byte* output, const byte* passwd, int pLen,
const byte* salt, int sLen, int iterations, int kLen, const byte* salt, int sLen, int iterations, int kLen,
int typeH, void* heap, int devId); int hashType, void* heap, int devId);
WOLFSSL_API int wc_PBKDF2(byte* output, const byte* passwd, int pLen, WOLFSSL_API int wc_PBKDF2(byte* output, const byte* passwd, int pLen,
const byte* salt, int sLen, int iterations, int kLen, const byte* salt, int sLen, int iterations, int kLen,
int typeH); int hashType);
WOLFSSL_API int wc_PKCS12_PBKDF(byte* output, const byte* passwd, int pLen, WOLFSSL_API int wc_PKCS12_PBKDF(byte* output, const byte* passwd, int passLen,
const byte* salt, int sLen, int iterations, const byte* salt, int saltLen, int iterations,
int kLen, int typeH, int purpose); int kLen, int hashType, int id);
WOLFSSL_API int wc_PKCS12_PBKDF_ex(byte* output, const byte* passwd,int passLen, WOLFSSL_API int wc_PKCS12_PBKDF_ex(byte* output, const byte* passwd,int passLen,
const byte* salt, int saltLen, int iterations, int kLen, const byte* salt, int saltLen, int iterations, int kLen,
int hashType, int id, void* heap); int hashType, int id, void* heap);

View File

@@ -212,7 +212,7 @@ struct WC_RNG {
#define RNG WC_RNG #define RNG WC_RNG
#endif #endif
WOLFSSL_API int wc_GenerateSeed(OS_Seed* os, byte* seed, word32 sz); WOLFSSL_API int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz);
#ifdef HAVE_WNR #ifdef HAVE_WNR
@@ -235,7 +235,7 @@ WOLFSSL_API int wc_InitRng_ex(WC_RNG* rng, void* heap, int devId);
WOLFSSL_API int wc_InitRngNonce(WC_RNG* rng, byte* nonce, word32 nonceSz); WOLFSSL_API int wc_InitRngNonce(WC_RNG* rng, byte* nonce, word32 nonceSz);
WOLFSSL_API int wc_InitRngNonce_ex(WC_RNG* rng, byte* nonce, word32 nonceSz, WOLFSSL_API int wc_InitRngNonce_ex(WC_RNG* rng, byte* nonce, word32 nonceSz,
void* heap, int devId); void* heap, int devId);
WOLFSSL_ABI WOLFSSL_API int wc_RNG_GenerateBlock(WC_RNG* rng, byte* b, word32 sz); WOLFSSL_ABI WOLFSSL_API int wc_RNG_GenerateBlock(WC_RNG* rng, byte* output, word32 sz);
WOLFSSL_API int wc_RNG_GenerateByte(WC_RNG* rng, byte* b); WOLFSSL_API int wc_RNG_GenerateByte(WC_RNG* rng, byte* b);
WOLFSSL_API int wc_FreeRng(WC_RNG* rng); WOLFSSL_API int wc_FreeRng(WC_RNG* rng);
#else #else
@@ -259,17 +259,17 @@ WOLFSSL_API int wc_FreeRng(WC_RNG* rng);
#endif #endif
#ifdef HAVE_HASHDRBG #ifdef HAVE_HASHDRBG
WOLFSSL_API int wc_RNG_DRBG_Reseed(WC_RNG* rng, const byte* entropy, WOLFSSL_API int wc_RNG_DRBG_Reseed(WC_RNG* rng, const byte* seed,
word32 entropySz); word32 seedSz);
WOLFSSL_API int wc_RNG_TestSeed(const byte* seed, word32 seedSz); WOLFSSL_API int wc_RNG_TestSeed(const byte* seed, word32 seedSz);
WOLFSSL_API int wc_RNG_HealthTest(int reseed, WOLFSSL_API int wc_RNG_HealthTest(int reseed,
const byte* entropyA, word32 entropyASz, const byte* seedA, word32 seedASz,
const byte* entropyB, word32 entropyBSz, const byte* seedB, word32 seedBSz,
byte* output, word32 outputSz); byte* output, word32 outputSz);
WOLFSSL_API int wc_RNG_HealthTest_ex(int reseed, WOLFSSL_API int wc_RNG_HealthTest_ex(int reseed,
const byte* nonce, word32 nonceSz, const byte* nonce, word32 nonceSz,
const byte* entropyA, word32 entropyASz, const byte* seedA, word32 seedASz,
const byte* entropyB, word32 entropyBSz, const byte* seedB, word32 seedBSz,
byte* output, word32 outputSz, byte* output, word32 outputSz,
void* heap, int devId); void* heap, int devId);
#endif /* HAVE_HASHDRBG */ #endif /* HAVE_HASHDRBG */