forked from wolfSSL/wolfssl
Merge pull request #7497 from douzzer/20240501-fix-pqcrypto-private_key-callback-names
20240501-fix-pqcrypto-private_key-callback-names
This commit is contained in:
@ -586,7 +586,7 @@ void wc_LmsKey_Free(LmsKey* key)
|
|||||||
*
|
*
|
||||||
* Returns 0 on success.
|
* Returns 0 on success.
|
||||||
* */
|
* */
|
||||||
int wc_LmsKey_SetWriteCb(LmsKey * key, write_private_key_cb write_cb)
|
int wc_LmsKey_SetWriteCb(LmsKey * key, wc_lms_write_private_key_cb write_cb)
|
||||||
{
|
{
|
||||||
if (key == NULL || write_cb == NULL) {
|
if (key == NULL || write_cb == NULL) {
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
@ -610,7 +610,7 @@ int wc_LmsKey_SetWriteCb(LmsKey * key, write_private_key_cb write_cb)
|
|||||||
*
|
*
|
||||||
* Returns 0 on success.
|
* Returns 0 on success.
|
||||||
* */
|
* */
|
||||||
int wc_LmsKey_SetReadCb(LmsKey * key, read_private_key_cb read_cb)
|
int wc_LmsKey_SetReadCb(LmsKey * key, wc_lms_read_private_key_cb read_cb)
|
||||||
{
|
{
|
||||||
if (key == NULL || read_cb == NULL) {
|
if (key == NULL || read_cb == NULL) {
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
|
@ -307,7 +307,7 @@ void wc_XmssKey_Free(XmssKey* key)
|
|||||||
* returns BAD_FUNC_ARG when a parameter is NULL.
|
* returns BAD_FUNC_ARG when a parameter is NULL.
|
||||||
* returns -1 on failure.
|
* returns -1 on failure.
|
||||||
* */
|
* */
|
||||||
int wc_XmssKey_SetWriteCb(XmssKey * key, write_private_key_cb write_cb)
|
int wc_XmssKey_SetWriteCb(XmssKey * key, wc_xmss_write_private_key_cb write_cb)
|
||||||
{
|
{
|
||||||
if (key == NULL || write_cb == NULL) {
|
if (key == NULL || write_cb == NULL) {
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
@ -336,7 +336,7 @@ int wc_XmssKey_SetWriteCb(XmssKey * key, write_private_key_cb write_cb)
|
|||||||
* returns BAD_FUNC_ARG when a parameter is NULL.
|
* returns BAD_FUNC_ARG when a parameter is NULL.
|
||||||
* returns -1 on failure.
|
* returns -1 on failure.
|
||||||
* */
|
* */
|
||||||
int wc_XmssKey_SetReadCb(XmssKey * key, read_private_key_cb read_cb)
|
int wc_XmssKey_SetReadCb(XmssKey * key, wc_xmss_read_private_key_cb read_cb)
|
||||||
{
|
{
|
||||||
if (key == NULL || read_cb == NULL) {
|
if (key == NULL || read_cb == NULL) {
|
||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
|
@ -53,8 +53,8 @@ struct LmsKey {
|
|||||||
unsigned char pub[HSS_MAX_PUBLIC_KEY_LEN];
|
unsigned char pub[HSS_MAX_PUBLIC_KEY_LEN];
|
||||||
#ifndef WOLFSSL_LMS_VERIFY_ONLY
|
#ifndef WOLFSSL_LMS_VERIFY_ONLY
|
||||||
hss_working_key * working_key;
|
hss_working_key * working_key;
|
||||||
write_private_key_cb write_private_key; /* Callback to write/update key. */
|
wc_lms_write_private_key_cb write_private_key; /* Callback to write/update key. */
|
||||||
read_private_key_cb read_private_key; /* Callback to read key. */
|
wc_lms_read_private_key_cb read_private_key; /* Callback to read key. */
|
||||||
void * context; /* Context arg passed to callbacks. */
|
void * context; /* Context arg passed to callbacks. */
|
||||||
hss_extra_info info;
|
hss_extra_info info;
|
||||||
#endif /* ifndef WOLFSSL_LMS_VERIFY_ONLY */
|
#endif /* ifndef WOLFSSL_LMS_VERIFY_ONLY */
|
||||||
|
@ -45,8 +45,8 @@ struct XmssKey {
|
|||||||
/* The secret key length is a function of xmss_params. */
|
/* The secret key length is a function of xmss_params. */
|
||||||
unsigned char * sk;
|
unsigned char * sk;
|
||||||
word32 sk_len;
|
word32 sk_len;
|
||||||
write_private_key_cb write_private_key; /* Callback to write/update key. */
|
wc_xmss_write_private_key_cb write_private_key; /* Callback to write/update key. */
|
||||||
read_private_key_cb read_private_key; /* Callback to read key. */
|
wc_xmss_read_private_key_cb read_private_key; /* Callback to read key. */
|
||||||
void * context; /* Context arg passed to callbacks. */
|
void * context; /* Context arg passed to callbacks. */
|
||||||
#endif /* ifndef WOLFSSL_XMSS_VERIFY_ONLY */
|
#endif /* ifndef WOLFSSL_XMSS_VERIFY_ONLY */
|
||||||
enum wc_XmssState state;
|
enum wc_XmssState state;
|
||||||
|
@ -34,8 +34,8 @@
|
|||||||
typedef struct LmsKey LmsKey;
|
typedef struct LmsKey LmsKey;
|
||||||
|
|
||||||
/* Private key write and read callbacks. */
|
/* Private key write and read callbacks. */
|
||||||
typedef int (*write_private_key_cb)(const byte * priv, word32 privSz, void *context);
|
typedef int (*wc_lms_write_private_key_cb)(const byte * priv, word32 privSz, void *context);
|
||||||
typedef int (*read_private_key_cb)(byte * priv, word32 privSz, void *context);
|
typedef int (*wc_lms_read_private_key_cb)(byte * priv, word32 privSz, void *context);
|
||||||
|
|
||||||
/* Return codes returned by private key callbacks. */
|
/* Return codes returned by private key callbacks. */
|
||||||
enum wc_LmsRc {
|
enum wc_LmsRc {
|
||||||
@ -138,9 +138,9 @@ WOLFSSL_API int wc_LmsKey_GetParameters(const LmsKey * key, int * levels,
|
|||||||
int * height, int * winternitz);
|
int * height, int * winternitz);
|
||||||
#ifndef WOLFSSL_LMS_VERIFY_ONLY
|
#ifndef WOLFSSL_LMS_VERIFY_ONLY
|
||||||
WOLFSSL_API int wc_LmsKey_SetWriteCb(LmsKey * key,
|
WOLFSSL_API int wc_LmsKey_SetWriteCb(LmsKey * key,
|
||||||
write_private_key_cb write_cb);
|
wc_lms_write_private_key_cb write_cb);
|
||||||
WOLFSSL_API int wc_LmsKey_SetReadCb(LmsKey * key,
|
WOLFSSL_API int wc_LmsKey_SetReadCb(LmsKey * key,
|
||||||
read_private_key_cb read_cb);
|
wc_lms_read_private_key_cb read_cb);
|
||||||
WOLFSSL_API int wc_LmsKey_SetContext(LmsKey * key, void * context);
|
WOLFSSL_API int wc_LmsKey_SetContext(LmsKey * key, void * context);
|
||||||
WOLFSSL_API int wc_LmsKey_MakeKey(LmsKey * key, WC_RNG * rng);
|
WOLFSSL_API int wc_LmsKey_MakeKey(LmsKey * key, WC_RNG * rng);
|
||||||
WOLFSSL_API int wc_LmsKey_Reload(LmsKey * key);
|
WOLFSSL_API int wc_LmsKey_Reload(LmsKey * key);
|
||||||
|
@ -160,9 +160,9 @@ enum wc_XmssState {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Private key write and read callbacks. */
|
/* Private key write and read callbacks. */
|
||||||
typedef enum wc_XmssRc (*write_private_key_cb)(const byte* priv, word32 privSz,
|
typedef enum wc_XmssRc (*wc_xmss_write_private_key_cb)(const byte* priv, word32 privSz,
|
||||||
void* context);
|
void* context);
|
||||||
typedef enum wc_XmssRc (*read_private_key_cb)(byte* priv, word32 privSz,
|
typedef enum wc_XmssRc (*wc_xmss_read_private_key_cb)(byte* priv, word32 privSz,
|
||||||
void* context);
|
void* context);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@ -173,9 +173,9 @@ WOLFSSL_API int wc_XmssKey_Init(XmssKey* key, void* heap, int devId);
|
|||||||
WOLFSSL_API int wc_XmssKey_SetParamStr(XmssKey* key, const char* str);
|
WOLFSSL_API int wc_XmssKey_SetParamStr(XmssKey* key, const char* str);
|
||||||
#ifndef WOLFSSL_XMSS_VERIFY_ONLY
|
#ifndef WOLFSSL_XMSS_VERIFY_ONLY
|
||||||
WOLFSSL_API int wc_XmssKey_SetWriteCb(XmssKey* key,
|
WOLFSSL_API int wc_XmssKey_SetWriteCb(XmssKey* key,
|
||||||
write_private_key_cb write_cb);
|
wc_xmss_write_private_key_cb write_cb);
|
||||||
WOLFSSL_API int wc_XmssKey_SetReadCb(XmssKey* key,
|
WOLFSSL_API int wc_XmssKey_SetReadCb(XmssKey* key,
|
||||||
read_private_key_cb read_cb);
|
wc_xmss_read_private_key_cb read_cb);
|
||||||
WOLFSSL_API int wc_XmssKey_SetContext(XmssKey* key, void* context);
|
WOLFSSL_API int wc_XmssKey_SetContext(XmssKey* key, void* context);
|
||||||
WOLFSSL_API int wc_XmssKey_MakeKey(XmssKey* key, WC_RNG* rng);
|
WOLFSSL_API int wc_XmssKey_MakeKey(XmssKey* key, WC_RNG* rng);
|
||||||
WOLFSSL_API int wc_XmssKey_Reload(XmssKey* key);
|
WOLFSSL_API int wc_XmssKey_Reload(XmssKey* key);
|
||||||
|
Reference in New Issue
Block a user