3737 #include <wolfcrypt/src/misc.c>
3838#endif
3939
40- #ifndef LMS_VERIFY_ONLY
40+ #ifndef WOLFSSL_LMS_VERIFY_ONLY
4141/* If built against hss_lib_thread.a, the hash-sigs lib will spawn
4242 * worker threads to parallelize cpu intensive tasks. This will mainly
4343 * speedup key generation and signing, and to a lesser extent
@@ -102,7 +102,8 @@ static bool LmsWritePrivKey(unsigned char *private_key,
102102 }
103103
104104 /* Use write callback that saves private key to non-volatile storage. */
105- ret = key -> write_private_key (private_key , len_private_key , key -> context );
105+ ret = key -> write_private_key (private_key , (word32 )len_private_key ,
106+ key -> context );
106107
107108 if (ret != WC_LMS_RC_SAVED_TO_NV_MEMORY ) {
108109 WOLFSSL_MSG ("error: LmsKey write_private_key failed" );
@@ -141,7 +142,8 @@ static bool LmsReadPrivKey(unsigned char *private_key,
141142 }
142143
143144 /* Use read callback that reads private key from non-volatile storage. */
144- ret = key -> read_private_key (private_key , len_private_key , key -> context );
145+ ret = key -> read_private_key (private_key , (word32 )len_private_key ,
146+ key -> context );
145147
146148 if (ret != WC_LMS_RC_READ_TO_MEMORY ) {
147149 WOLFSSL_MSG ("error: LmsKey read_private_key failed" );
@@ -152,7 +154,7 @@ static bool LmsReadPrivKey(unsigned char *private_key,
152154
153155 return true;
154156}
155- #endif /* ifndef LMS_VERIFY_ONLY */
157+ #endif /* ifndef WOLFSSL_LMS_VERIFY_ONLY */
156158
157159const char * wc_LmsKey_ParmToStr (enum wc_LmsParm lmsParm )
158160{
@@ -244,7 +246,7 @@ int wc_LmsKey_Init(LmsKey * key, void * heap, int devId)
244246
245247 ForceZero (key , sizeof (LmsKey ));
246248
247- #ifndef LMS_VERIFY_ONLY
249+ #ifndef WOLFSSL_LMS_VERIFY_ONLY
248250 hss_init_extra_info (& key -> info );
249251 /* Set the max number of worker threads that hash-sigs can spawn. */
250252 hss_extra_info_set_threads (& key -> info , EXT_LMS_MAX_THREADS );
@@ -253,7 +255,7 @@ int wc_LmsKey_Init(LmsKey * key, void * heap, int devId)
253255 key -> write_private_key = NULL ;
254256 key -> read_private_key = NULL ;
255257 key -> context = NULL ;
256- #endif /* ifndef LMS_VERIFY_ONLY */
258+ #endif /* ifndef WOLFSSL_LMS_VERIFY_ONLY */
257259 key -> state = WC_LMS_STATE_INITED ;
258260
259261 return 0 ;
@@ -483,12 +485,12 @@ void wc_LmsKey_Free(LmsKey* key)
483485 return ;
484486 }
485487
486- #ifndef LMS_VERIFY_ONLY
488+ #ifndef WOLFSSL_LMS_VERIFY_ONLY
487489 if (key -> working_key != NULL ) {
488490 hss_free_working_key (key -> working_key );
489491 key -> working_key = NULL ;
490492 }
491- #endif /* ifndef LMS_VERIFY_ONLY */
493+ #endif /* ifndef WOLFSSL_LMS_VERIFY_ONLY */
492494
493495 ForceZero (key , sizeof (LmsKey ));
494496
@@ -497,7 +499,7 @@ void wc_LmsKey_Free(LmsKey* key)
497499 return ;
498500}
499501
500- #ifndef LMS_VERIFY_ONLY
502+ #ifndef WOLFSSL_LMS_VERIFY_ONLY
501503/* Set the write private key callback to the LMS key structure.
502504 *
503505 * The callback must be able to write/update the private key to
@@ -807,7 +809,7 @@ int wc_LmsKey_SigsLeft(LmsKey * key)
807809 return 1 ;
808810}
809811
810- #endif /* ifndef LMS_VERIFY_ONLY */
812+ #endif /* ifndef WOLFSSL_LMS_VERIFY_ONLY */
811813
812814/* Given a levels, height, winternitz parameter set, determine
813815 * the public key length */
@@ -950,7 +952,7 @@ int wc_LmsKey_Verify(LmsKey * key, const byte * sig, word32 sigSz,
950952 return BAD_FUNC_ARG ;
951953 }
952954
953- #ifdef LMS_VERIFY_ONLY
955+ #ifdef WOLFSSL_LMS_VERIFY_ONLY
954956 result = hss_validate_signature (key -> pub , (const void * ) msg , msgSz , sig ,
955957 sigSz , NULL );
956958#else
0 commit comments