Skip to content

Commit 5905f92

Browse files
committed
fix namespace collision: rename types read_private_key_cb and write_private_key_cb to wc_{lms,xmss}_read_private_key_cb and wc_{lms,xmss}_write_private_key_cb.
1 parent 866468e commit 5905f92

6 files changed

Lines changed: 16 additions & 16 deletions

File tree

wolfcrypt/src/ext_lms.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ void wc_LmsKey_Free(LmsKey* key)
586586
*
587587
* Returns 0 on success.
588588
* */
589-
int wc_LmsKey_SetWriteCb(LmsKey * key, write_private_key_cb write_cb)
589+
int wc_LmsKey_SetWriteCb(LmsKey * key, wc_lms_write_private_key_cb write_cb)
590590
{
591591
if (key == NULL || write_cb == NULL) {
592592
return BAD_FUNC_ARG;
@@ -610,7 +610,7 @@ int wc_LmsKey_SetWriteCb(LmsKey * key, write_private_key_cb write_cb)
610610
*
611611
* Returns 0 on success.
612612
* */
613-
int wc_LmsKey_SetReadCb(LmsKey * key, read_private_key_cb read_cb)
613+
int wc_LmsKey_SetReadCb(LmsKey * key, wc_lms_read_private_key_cb read_cb)
614614
{
615615
if (key == NULL || read_cb == NULL) {
616616
return BAD_FUNC_ARG;

wolfcrypt/src/ext_xmss.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ void wc_XmssKey_Free(XmssKey* key)
307307
* returns BAD_FUNC_ARG when a parameter is NULL.
308308
* returns -1 on failure.
309309
* */
310-
int wc_XmssKey_SetWriteCb(XmssKey * key, write_private_key_cb write_cb)
310+
int wc_XmssKey_SetWriteCb(XmssKey * key, wc_xmss_write_private_key_cb write_cb)
311311
{
312312
if (key == NULL || write_cb == NULL) {
313313
return BAD_FUNC_ARG;
@@ -336,7 +336,7 @@ int wc_XmssKey_SetWriteCb(XmssKey * key, write_private_key_cb write_cb)
336336
* returns BAD_FUNC_ARG when a parameter is NULL.
337337
* returns -1 on failure.
338338
* */
339-
int wc_XmssKey_SetReadCb(XmssKey * key, read_private_key_cb read_cb)
339+
int wc_XmssKey_SetReadCb(XmssKey * key, wc_xmss_read_private_key_cb read_cb)
340340
{
341341
if (key == NULL || read_cb == NULL) {
342342
return BAD_FUNC_ARG;

wolfssl/wolfcrypt/ext_lms.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ struct LmsKey {
5353
unsigned char pub[HSS_MAX_PUBLIC_KEY_LEN];
5454
#ifndef WOLFSSL_LMS_VERIFY_ONLY
5555
hss_working_key * working_key;
56-
write_private_key_cb write_private_key; /* Callback to write/update key. */
57-
read_private_key_cb read_private_key; /* Callback to read key. */
56+
wc_lms_write_private_key_cb write_private_key; /* Callback to write/update key. */
57+
wc_lms_read_private_key_cb read_private_key; /* Callback to read key. */
5858
void * context; /* Context arg passed to callbacks. */
5959
hss_extra_info info;
6060
#endif /* ifndef WOLFSSL_LMS_VERIFY_ONLY */

wolfssl/wolfcrypt/ext_xmss.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ struct XmssKey {
4545
/* The secret key length is a function of xmss_params. */
4646
unsigned char * sk;
4747
word32 sk_len;
48-
write_private_key_cb write_private_key; /* Callback to write/update key. */
49-
read_private_key_cb read_private_key; /* Callback to read key. */
48+
wc_xmss_write_private_key_cb write_private_key; /* Callback to write/update key. */
49+
wc_xmss_read_private_key_cb read_private_key; /* Callback to read key. */
5050
void * context; /* Context arg passed to callbacks. */
5151
#endif /* ifndef WOLFSSL_XMSS_VERIFY_ONLY */
5252
enum wc_XmssState state;

wolfssl/wolfcrypt/lms.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
typedef struct LmsKey LmsKey;
3535

3636
/* Private key write and read callbacks. */
37-
typedef int (*write_private_key_cb)(const byte * priv, word32 privSz, void *context);
38-
typedef int (*read_private_key_cb)(byte * priv, word32 privSz, void *context);
37+
typedef int (*wc_lms_write_private_key_cb)(const byte * priv, word32 privSz, void *context);
38+
typedef int (*wc_lms_read_private_key_cb)(byte * priv, word32 privSz, void *context);
3939

4040
/* Return codes returned by private key callbacks. */
4141
enum wc_LmsRc {
@@ -138,9 +138,9 @@ WOLFSSL_API int wc_LmsKey_GetParameters(const LmsKey * key, int * levels,
138138
int * height, int * winternitz);
139139
#ifndef WOLFSSL_LMS_VERIFY_ONLY
140140
WOLFSSL_API int wc_LmsKey_SetWriteCb(LmsKey * key,
141-
write_private_key_cb write_cb);
141+
wc_lms_write_private_key_cb write_cb);
142142
WOLFSSL_API int wc_LmsKey_SetReadCb(LmsKey * key,
143-
read_private_key_cb read_cb);
143+
wc_lms_read_private_key_cb read_cb);
144144
WOLFSSL_API int wc_LmsKey_SetContext(LmsKey * key, void * context);
145145
WOLFSSL_API int wc_LmsKey_MakeKey(LmsKey * key, WC_RNG * rng);
146146
WOLFSSL_API int wc_LmsKey_Reload(LmsKey * key);

wolfssl/wolfcrypt/xmss.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ enum wc_XmssState {
160160
};
161161

162162
/* Private key write and read callbacks. */
163-
typedef enum wc_XmssRc (*write_private_key_cb)(const byte* priv, word32 privSz,
163+
typedef enum wc_XmssRc (*wc_xmss_write_private_key_cb)(const byte* priv, word32 privSz,
164164
void* context);
165-
typedef enum wc_XmssRc (*read_private_key_cb)(byte* priv, word32 privSz,
165+
typedef enum wc_XmssRc (*wc_xmss_read_private_key_cb)(byte* priv, word32 privSz,
166166
void* context);
167167

168168
#ifdef __cplusplus
@@ -173,9 +173,9 @@ WOLFSSL_API int wc_XmssKey_Init(XmssKey* key, void* heap, int devId);
173173
WOLFSSL_API int wc_XmssKey_SetParamStr(XmssKey* key, const char* str);
174174
#ifndef WOLFSSL_XMSS_VERIFY_ONLY
175175
WOLFSSL_API int wc_XmssKey_SetWriteCb(XmssKey* key,
176-
write_private_key_cb write_cb);
176+
wc_xmss_write_private_key_cb write_cb);
177177
WOLFSSL_API int wc_XmssKey_SetReadCb(XmssKey* key,
178-
read_private_key_cb read_cb);
178+
wc_xmss_read_private_key_cb read_cb);
179179
WOLFSSL_API int wc_XmssKey_SetContext(XmssKey* key, void* context);
180180
WOLFSSL_API int wc_XmssKey_MakeKey(XmssKey* key, WC_RNG* rng);
181181
WOLFSSL_API int wc_XmssKey_Reload(XmssKey* key);

0 commit comments

Comments
 (0)