@@ -1153,14 +1153,8 @@ static int _EccMakeKey(whClientContext* ctx, int size, int curveId,
11531153
11541154 ret = wh_Client_SendRequest (ctx , group , action , req_len ,
11551155 (uint8_t * )dataPtr );
1156- <<<<<<< HEAD
1157- WH_DEBUG_CLIENT_VERBOSE ("%s Req sent:size:%u, ret:%d\n" , __func__ , req -> sz , ret );
1158- = == == ==
1159- #ifdef DEBUG_CRYPTOCB_VERBOSE
1160- printf ("[client] %s Req sent:size:%u, ret:%d\n" , __func__ ,
1156+ WH_DEBUG_CLIENT_VERBOSE ("%s Req sent:size:%u, ret:%d\n" , __func__ ,
11611157 (unsigned int )req -> sz , ret );
1162- #endif
1163- >>>>>>> main
11641158 if (ret == WH_ERROR_OK ) {
11651159 /* Response Message */
11661160 uint16_t res_len ;
@@ -1174,16 +1168,9 @@ static int _EccMakeKey(whClientContext* ctx, int size, int curveId,
11741168 * rc */
11751169 ret = _getCryptoResponse (dataPtr , WC_PK_TYPE_EC_KEYGEN ,
11761170 (uint8_t * * )& res );
1177- <<<<<<< HEAD
11781171 WH_DEBUG_CLIENT_VERBOSE ("%s Res recv:keyid:%u, len:%u, ret:%d\n" ,
1179- __func__ , res -> keyId , res -> len , ret );
1180- = == == ==
1181- #ifdef DEBUG_CRYPTOCB_VERBOSE
1182- printf ("[client] %s Res recv:keyid:%u, len:%u, ret:%d\n" ,
11831172 __func__ , (unsigned int )res -> keyId ,
11841173 (unsigned int )res -> len , ret );
1185- #endif
1186- >>>>>>> main
11871174 /* wolfCrypt allows positive error codes on success in some
11881175 * scenarios */
11891176 if (ret >= 0 ) {
@@ -1326,16 +1313,9 @@ int wh_Client_EccSharedSecret(whClientContext* ctx, ecc_key* priv_key,
13261313 /* Send Request */
13271314 ret = wh_Client_SendRequest (ctx , group , action , req_len ,
13281315 (uint8_t * )dataPtr );
1329- <<<<<<< HEAD
13301316 WH_DEBUG_CLIENT_VERBOSE ("%s req sent. priv:%u pub:%u\n" , __func__ ,
1331- req -> privateKeyId , req -> publicKeyId );
1332- = == == ==
1333- #ifdef DEBUG_CRYPTOCB_VERBOSE
1334- printf ("[client] %s req sent. priv:%u pub:%u\n" , __func__ ,
13351317 (unsigned int )req -> privateKeyId ,
13361318 (unsigned int )req -> publicKeyId );
1337- #endif
1338- >>>>>>> main
13391319 if (ret == WH_ERROR_OK ) {
13401320 /* Server will evict. Reset our flags */
13411321 pub_evict = prv_evict = 0 ;
@@ -1619,13 +1599,9 @@ int wh_Client_EccVerify(whClientContext* ctx, ecc_key* key, const uint8_t* sig,
16191599
16201600 WH_DEBUG_CLIENT_VERBOSE ("EccVerify req: key_id=%x, sig_len=%u, "
16211601 "hash_len=%u, options=%u\n" ,
1622- <<<<<<< HEAD
1623- key_id , sig_len , hash_len , options );
1624- #ifdef WOLFHSM_CFG_HEXDUMP
1625- == == == =
16261602 key_id , (unsigned int )sig_len , (unsigned int )hash_len ,
16271603 (unsigned int )options );
1628- >>>>>> > main
1604+ #ifdef WOLFHSM_CFG_HEXDUMP
16291605 wh_Utils_Hexdump ("[client] EccVerify req:" , (uint8_t * )req , req_len );
16301606 if ((sig != NULL ) && (sig_len > 0 )) {
16311607 wh_Utils_Hexdump ("[client] EccVerify sig:" , sig , sig_len );
@@ -1868,15 +1844,8 @@ static int _Curve25519MakeKey(whClientContext* ctx, uint16_t size,
18681844
18691845 ret =
18701846 wh_Client_SendRequest (ctx , group , action , data_len , (uint8_t * )dataPtr );
1871- <<<<<<< HEAD
1872- WH_DEBUG_CLIENT_VERBOSE ("Curve25519 KeyGen Req sent:size:%u, ret:%d\n" , req -> sz ,
1873- ret );
1874- = == == ==
1875- #ifdef DEBUG_CRYPTOCB_VERBOSE
1876- printf ("[client] Curve25519 KeyGen Req sent:size:%u, ret:%d\n" ,
1847+ WH_DEBUG_CLIENT_VERBOSE ("Curve25519 KeyGen Req sent:size:%u, ret:%d\n" ,
18771848 (unsigned int )req -> sz , ret );
1878- #endif
1879- >>>>>>> main
18801849 if (ret == 0 ) {
18811850 do {
18821851 ret = wh_Client_RecvResponse (ctx , & group , & action , & data_len ,
@@ -1893,12 +1862,7 @@ static int _Curve25519MakeKey(whClientContext* ctx, uint16_t size,
18931862 if (ret >= 0 ) {
18941863 WH_DEBUG_CLIENT_VERBOSE ("Curve25519 KeyGen Res recv:keyid:%u, len:%u, "
18951864 "ret:%d\n" ,
1896- <<<<<<< HEAD
1897- res -> keyId , res -> len , ret );
1898- = == == ==
18991865 (unsigned int )res -> keyId , (unsigned int )res -> len , ret );
1900- #endif
1901- >>>>>>> main
19021866 /* Key is cached on server or is ephemeral */
19031867 key_id = (whKeyId )(res -> keyId );
19041868
@@ -2034,16 +1998,9 @@ int wh_Client_Curve25519SharedSecret(whClientContext* ctx,
20341998 /* Send Request */
20351999 ret = wh_Client_SendRequest (ctx , group , action , req_len ,
20362000 (uint8_t * )dataPtr );
2037- <<<<<<< HEAD
20382001 WH_DEBUG_CLIENT_VERBOSE ("%s req sent. priv:%u pub:%u\n" , __func__ ,
2039- req -> privateKeyId , req -> publicKeyId );
2040- = == == ==
2041- #ifdef DEBUG_CRYPTOCB_VERBOSE
2042- printf ("[client] %s req sent. priv:%u pub:%u\n" , __func__ ,
20432002 (unsigned int )req -> privateKeyId ,
20442003 (unsigned int )req -> publicKeyId );
2045- #endif
2046- >>>>>>> main
20472004 if (ret == WH_ERROR_OK ) {
20482005 whMessageCrypto_Curve25519Response * res = NULL ;
20492006 uint16_t res_len ;
@@ -2233,30 +2190,17 @@ static int _RsaMakeKey(whClientContext* ctx, uint32_t size, uint32_t e,
22332190
22342191 /* Send Request */
22352192 ret = wh_Client_SendRequest (ctx , group , action , req_len , dataPtr );
2236- <<<<<<< HEAD
2237- WH_DEBUG_CLIENT_VERBOSE ("RSA KeyGen Req sent:size:%u, e:%u, ret:%d\n" , req -> size , req -> e ,
2238- ret );
2239- = == == ==
2240- #ifdef DEBUG_CRYPTOCB_VERBOSE
2241- printf ("RSA KeyGen Req sent:size:%u, e:%u, ret:%d\n" ,
2193+ WH_DEBUG_CLIENT_VERBOSE ("RSA KeyGen Req sent:size:%u, e:%u, ret:%d\n" ,
22422194 (unsigned int )req -> size , (unsigned int )req -> e , ret );
2243- #endif
2244- >>>>>>> main
22452195 if (ret == 0 ) {
22462196 uint16_t res_len = 0 ;
22472197 do {
22482198 ret =
22492199 wh_Client_RecvResponse (ctx , & group , & action , & res_len , dataPtr );
22502200 } while (ret == WH_ERROR_NOTREADY );
22512201
2252- <<<<<<< HEAD
2253- WH_DEBUG_CLIENT_VERBOSE ("RSA KeyGen Res recv: ret:%d, res_len: %u\n" , ret , res_len );
2254- = == == ==
2255- #ifdef DEBUG_CRYPTOCB_VERBOSE
2256- printf ("RSA KeyGen Res recv: ret:%d, res_len: %u\n" , ret ,
2202+ WH_DEBUG_CLIENT_VERBOSE ("RSA KeyGen Res recv: ret:%d, res_len: %u\n" , ret ,
22572203 (unsigned int )res_len );
2258- #endif
2259- >>>>>>> main
22602204
22612205 if (ret == WH_ERROR_OK ) {
22622206 /* Get response structure pointer, validates generic header rc */
@@ -2630,15 +2574,9 @@ static int _HkdfMakeKey(whClientContext* ctx, int hashType, whKeyId keyIdIn,
26302574
26312575 WH_DEBUG_CLIENT_VERBOSE ("HKDF Req sent: hashType:%d inKeySz:%u saltSz:%u infoSz:%u outSz:%u "
26322576 "ret:%d\n" ,
2633- <<<<<<< HEAD
2634- req -> hashType , req -> inKeySz , req -> saltSz , req -> infoSz , req -> outSz ,
2635- ret );
2636- = == == ==
26372577 (int )req -> hashType , (unsigned int )req -> inKeySz ,
26382578 (unsigned int )req -> saltSz , (unsigned int )req -> infoSz ,
26392579 (unsigned int )req -> outSz , ret );
2640- #endif
2641- >>>>>>> main
26422580
26432581 if (ret == 0 ) {
26442582 uint16_t res_len = 0 ;
@@ -2647,14 +2585,8 @@ static int _HkdfMakeKey(whClientContext* ctx, int hashType, whKeyId keyIdIn,
26472585 wh_Client_RecvResponse (ctx , & group , & action , & res_len , dataPtr );
26482586 } while (ret == WH_ERROR_NOTREADY );
26492587
2650- <<<<<<< HEAD
2651- WH_DEBUG_CLIENT_VERBOSE ("HKDF Res recv: ret:%d, res_len: %u\n" , ret , res_len );
2652- = == == ==
2653- #ifdef DEBUG_CRYPTOCB_VERBOSE
2654- printf ("HKDF Res recv: ret:%d, res_len: %u\n" , ret ,
2588+ WH_DEBUG_CLIENT_VERBOSE ("HKDF Res recv: ret:%d, res_len: %u\n" , ret ,
26552589 (unsigned int )res_len );
2656- #endif
2657- >>>>>>> main
26582590
26592591 if (ret == WH_ERROR_OK ) {
26602592 /* Get response structure pointer, validates generic header rc */
@@ -2677,15 +2609,8 @@ static int _HkdfMakeKey(whClientContext* ctx, int hashType, whKeyId keyIdIn,
26772609 uint8_t * hkdf_out = (uint8_t * )(res + 1 );
26782610 memcpy (out , hkdf_out , res -> outSz );
26792611
2680- <<<<<<< HEAD
2681- WH_DEBUG_CLIENT_VERBOSE ("%s Set key_id:%x with flags:%x outSz:%u\n" ,
2682- __func__ , key_id , flags , res -> outSz );
2683- = == == ==
2684- #ifdef DEBUG_CRYPTOCB_VERBOSE
2685- printf ("[client] %s Set key_id:%x with flags:%x outSz:%u\n" ,
2612+ WH_DEBUG_CLIENT_VERBOSE ("%s Set key_id:%x with flags:%x outSz:%u\n" ,
26862613 __func__ , key_id , flags , (unsigned int )res -> outSz );
2687- #endif
2688- >>>>>>> main
26892614 }
26902615 else {
26912616 /* Server returned more than we can handle - error */
@@ -3093,16 +3018,9 @@ static int _xferSha256BlockAndUpdateDigest(whClientContext* ctx,
30933018 wh_Utils_Hexdump (" [client] resumeHash: " , req -> resumeState .hash ,
30943019 (isLastBlock ) ? req -> lastBlockLen
30953020 : WC_SHA256_BLOCK_SIZE );
3096- <<<<<<< HEAD
3097- #endif
3098- WH_DEBUG_CLIENT_VERBOSE (" hiLen: %u, loLen: %u\n" , req -> resumeState .hiLen ,
3099- req -> resumeState .loLen );
3100- #ifdef WOLFHSM_CFG_HEXDUMP
3101- == == == =
3102- printf (" [client] hiLen: %u, loLen: %u\n" ,
3021+ WH_DEBUG_CLIENT_VERBOSE (" hiLen: %u, loLen: %u\n" ,
31033022 (unsigned int )req -> resumeState .hiLen ,
31043023 (unsigned int )req -> resumeState .loLen );
3105- >>>>>>> main
31063024 }
31073025#endif
31083026 WH_DEBUG_CLIENT_VERBOSE (" ret = %d\n" , ret );
@@ -3118,13 +3036,7 @@ static int _xferSha256BlockAndUpdateDigest(whClientContext* ctx,
31183036 ret = _getCryptoResponse (dataPtr , WC_HASH_TYPE_SHA256 , (uint8_t * * )& res );
31193037 /* wolfCrypt allows positive error codes on success in some scenarios */
31203038 if (ret >= 0 ) {
3121- <<<<<<< HEAD
3122- WH_DEBUG_CLIENT_VERBOSE ("ERROR Client SHA256 Res recv: ret=%d" , ret );
3123- = == == ==
3124- #ifdef DEBUG_CRYPTOCB_VERBOSE
3125- printf ("[client] Client SHA256 Res recv: ret=%d" , ret );
3126- #endif /* DEBUG_CRYPTOCB_VERBOSE */
3127- >>>>>>> main
3039+ WH_DEBUG_CLIENT_VERBOSE ("Client SHA256 Res recv: ret=%d" , ret );
31283040 /* Store the received intermediate hash in the sha256
31293041 * context and indicate the field is now valid and
31303042 * should be passed back and forth to the server */
@@ -3257,14 +3169,8 @@ int wh_Client_Sha256Dma(whClientContext* ctx, wc_Sha256* sha, const uint8_t* in,
32573169 /* Caller invoked SHA Update:
32583170 * wc_CryptoCb_Sha256Hash(sha256, data, len, NULL) */
32593171 if ((ret == WH_ERROR_OK ) && (in != NULL )) {
3260- <<<<<<< HEAD
3261- WH_DEBUG_CLIENT_VERBOSE ("SHA256 DMA UPDATE: inAddr=%p, inSz=%u\n" , in , inLen );
3262- = == == ==
3263- #ifdef DEBUG_CRYPTOCB_VERBOSE
3264- printf ("[client] SHA256 DMA UPDATE: inAddr=%p, inSz=%u\n" , in ,
3172+ WH_DEBUG_CLIENT_VERBOSE ("SHA256 DMA UPDATE: inAddr=%p, inSz=%u\n" , in ,
32653173 (unsigned int )inLen );
3266- #endif
3267- >>>>>>> main
32683174
32693175 ret = wh_Client_SendRequest (
32703176 ctx , group , WC_ALGO_TYPE_HASH ,
@@ -3416,13 +3322,7 @@ static int _xferSha224BlockAndUpdateDigest(whClientContext* ctx,
34163322 ret = _getCryptoResponse (dataPtr , WC_HASH_TYPE_SHA224 , (uint8_t * * )& res );
34173323 /* wolfCrypt allows positive error codes on success in some scenarios */
34183324 if (ret >= 0 ) {
3419- <<<<<<< HEAD
3420- WH_DEBUG_CLIENT_VERBOSE ("ERROR Client SHA224 Res recv: ret=%d" , ret );
3421- = == == ==
3422- #ifdef DEBUG_CRYPTOCB_VERBOSE
3423- printf ("[client] Client SHA224 Res recv: ret=%d" , ret );
3424- #endif /* DEBUG_CRYPTOCB_VERBOSE */
3425- >>>>>>> main
3325+ WH_DEBUG_CLIENT_VERBOSE ("Client SHA224 Res recv: ret=%d" , ret );
34263326 /* Store the received intermediate hash in the sha224
34273327 * context and indicate the field is now valid and
34283328 * should be passed back and forth to the server.
@@ -3533,14 +3433,8 @@ int wh_Client_Sha224Dma(whClientContext* ctx, wc_Sha224* sha, const uint8_t* in,
35333433 req -> input .sz = inLen ;
35343434 req -> output .addr = (uint64_t )(uintptr_t )out ;
35353435 req -> output .sz = WC_SHA224_DIGEST_SIZE ; /* not needed, but YOLO */
3536- <<<<<<< HEAD
3537- WH_DEBUG_CLIENT_VERBOSE ("SHA224 DMA UPDATE: inAddr=%p, inSz=%u\n" , in , inLen );
3538- = == == ==
3539- #ifdef DEBUG_CRYPTOCB_VERBOSE
3540- printf ("[client] SHA224 DMA UPDATE: inAddr=%p, inSz=%u\n" , in ,
3436+ WH_DEBUG_CLIENT_VERBOSE ("SHA224 DMA UPDATE: inAddr=%p, inSz=%u\n" , in ,
35413437 (unsigned int )inLen );
3542- #endif
3543- >>>>>>> main
35443438 ret = wh_Client_SendRequest (
35453439 ctx , group , WC_ALGO_TYPE_HASH ,
35463440 sizeof (whMessageCrypto_GenericRequestHeader ) + sizeof (* req ),
@@ -3681,13 +3575,7 @@ static int _xferSha384BlockAndUpdateDigest(whClientContext* ctx,
36813575 ret = _getCryptoResponse (dataPtr , WC_HASH_TYPE_SHA384 , (uint8_t * * )& res );
36823576 /* wolfCrypt allows positive error codes on success in some scenarios */
36833577 if (ret >= 0 ) {
3684- <<<<<<< HEAD
3685- WH_DEBUG_CLIENT_VERBOSE ("ERROR Client SHA384 Res recv: ret=%d" , ret );
3686- = == == ==
3687- #ifdef DEBUG_CRYPTOCB_VERBOSE
3688- printf ("[client] Client SHA384 Res recv: ret=%d" , ret );
3689- #endif /* DEBUG_CRYPTOCB_VERBOSE */
3690- >>>>>>> main
3578+ WH_DEBUG_CLIENT_VERBOSE ("Client SHA384 Res recv: ret=%d" , ret );
36913579 /* Store the received intermediate hash in the sha384
36923580 * context and indicate the field is now valid and
36933581 * should be passed back and forth to the server
@@ -3796,14 +3684,8 @@ int wh_Client_Sha384Dma(whClientContext* ctx, wc_Sha384* sha, const uint8_t* in,
37963684 req -> input .sz = inLen ;
37973685 req -> output .addr = (uint64_t )(uintptr_t )out ;
37983686 req -> output .sz = WC_SHA384_DIGEST_SIZE ; /* not needed, but YOLO */
3799- <<<<<<< HEAD
3800- WH_DEBUG_CLIENT_VERBOSE ("SHA384 DMA UPDATE: inAddr=%p, inSz=%u\n" , in , inLen );
3801- = == == ==
3802- #ifdef DEBUG_CRYPTOCB_VERBOSE
3803- printf ("[client] SHA384 DMA UPDATE: inAddr=%p, inSz=%u\n" , in ,
3687+ WH_DEBUG_CLIENT_VERBOSE ("SHA384 DMA UPDATE: inAddr=%p, inSz=%u\n" , in ,
38043688 (unsigned int )inLen );
3805- #endif
3806- >>>>>>> main
38073689 ret = wh_Client_SendRequest (
38083690 ctx , group , WC_ALGO_TYPE_HASH ,
38093691 sizeof (whMessageCrypto_GenericRequestHeader ) + sizeof (* req ),
@@ -3945,15 +3827,8 @@ static int _xferSha512BlockAndUpdateDigest(whClientContext* ctx,
39453827 ret = _getCryptoResponse (dataPtr , WC_HASH_TYPE_SHA512 , (uint8_t * * )& res );
39463828 /* wolfCrypt allows positive error codes on success in some scenarios */
39473829 if (ret >= 0 ) {
3948- <<<<<<< HEAD
3949- WH_DEBUG_CLIENT_VERBOSE ("ERROR Client SHA512 Res recv: ret=%d" , ret );
3830+ WH_DEBUG_CLIENT_VERBOSE ("Client SHA512 Res recv: ret=%d" , ret );
39503831 WH_DEBUG_CLIENT_VERBOSE ("hashType: %d\n" , sha512 -> hashType );
3951- = == == ==
3952- #ifdef DEBUG_CRYPTOCB_VERBOSE
3953- printf ("[client] Client SHA512 Res recv: ret=%d" , ret );
3954- printf ("[client] hashType: %d\n" , sha512 -> hashType );
3955- #endif /* DEBUG_CRYPTOCB_VERBOSE */
3956- >>>>>>> main
39573832 /* Store the received intermediate hash in the sha512
39583833 * context and indicate the field is now valid and
39593834 * should be passed back and forth to the server */
@@ -4072,14 +3947,8 @@ int wh_Client_Sha512Dma(whClientContext* ctx, wc_Sha512* sha, const uint8_t* in,
40723947 req -> input .sz = inLen ;
40733948 req -> output .addr = (uint64_t )(uintptr_t )out ;
40743949 req -> output .sz = WC_SHA512_DIGEST_SIZE ; /* not needed, but YOLO */
4075- <<<<<<< HEAD
4076- WH_DEBUG_CLIENT_VERBOSE ("SHA512 DMA UPDATE: inAddr=%p, inSz=%u\n" , in , inLen );
4077- = == == ==
4078- #ifdef DEBUG_CRYPTOCB_VERBOSE
4079- printf ("[client] SHA512 DMA UPDATE: inAddr=%p, inSz=%u\n" , in ,
3950+ WH_DEBUG_CLIENT_VERBOSE ("SHA512 DMA UPDATE: inAddr=%p, inSz=%u\n" , in ,
40803951 (unsigned int )inLen );
4081- #endif
4082- >>>>>>> main
40833952 ret = wh_Client_SendRequest (
40843953 ctx , group , WC_ALGO_TYPE_HASH ,
40853954 sizeof (whMessageCrypto_GenericRequestHeader ) + sizeof (* req ),
@@ -4283,15 +4152,8 @@ static int _MlDsaMakeKey(whClientContext* ctx, int size, int level,
42834152
42844153 ret = wh_Client_SendRequest (ctx , group , action , req_len ,
42854154 (uint8_t * )dataPtr );
4286- <<<<<<< HEAD
4287- WH_DEBUG_CLIENT_VERBOSE ("%s Req sent:size:%u, ret:%d\n" , __func__ , req -> sz ,
4288- ret );
4289- = == == ==
4290- #ifdef DEBUG_CRYPTOCB_VERBOSE
4291- printf ("[client] %s Req sent:size:%u, ret:%d\n" , __func__ ,
4155+ WH_DEBUG_CLIENT_VERBOSE ("%s Req sent:size:%u, ret:%d\n" , __func__ ,
42924156 (unsigned int )req -> sz , ret );
4293- #endif
4294- >>>>>>> main
42954157 if (ret == 0 ) {
42964158 uint16_t res_len ;
42974159 do {
@@ -4307,18 +4169,10 @@ static int _MlDsaMakeKey(whClientContext* ctx, int size, int level,
43074169 /* wolfCrypt allows positive error codes on success in some
43084170 * scenarios */
43094171 if (ret >= 0 ) {
4310- <<<<<<< HEAD
43114172 WH_DEBUG_CLIENT_VERBOSE (
43124173 "%s Res recv:keyid:%u, len:%u, ret:%d\n" ,
4313- __func__ , res -> keyId , res -> len , ret );
4314- = == == ==
4315- #ifdef DEBUG_CRYPTOCB_VERBOSE
4316- printf (
4317- "[client] %s Res recv:keyid:%u, len:%u, ret:%d\n" ,
43184174 __func__ , (unsigned int )res -> keyId ,
43194175 (unsigned int )res -> len , ret );
4320- #endif
4321- >>>>>>> main
43224176 /* Key is cached on server or is ephemeral */
43234177 key_id = (whKeyId )(res -> keyId );
43244178
0 commit comments