@@ -1774,8 +1774,8 @@ static int _HandleSha256(whServerContext* ctx, uint16_t magic,
17741774
17751775 /* Translate the response */
17761776 if (ret == 0 ) {
1777- ret = wh_MessageCrypto_TranslateSha2Response ( magic , & res ,
1778- cryptoDataOut );
1777+ ret =
1778+ wh_MessageCrypto_TranslateSha2Response ( magic , & res , cryptoDataOut );
17791779 if (ret == 0 ) {
17801780 * outSize = sizeof (res );
17811781 }
@@ -1790,10 +1790,10 @@ static int _HandleSha224(whServerContext* ctx, uint16_t magic,
17901790 const void * cryptoDataIn , uint16_t inSize ,
17911791 void * cryptoDataOut , uint16_t * outSize )
17921792{
1793- int ret = 0 ;
1794- wc_Sha224 sha224 [1 ];
1795- whMessageCrypto_Sha256Request req ;
1796- whMessageCrypto_Sha2Response res ;
1793+ int ret = 0 ;
1794+ wc_Sha224 sha224 [1 ];
1795+ whMessageCrypto_Sha256Request req ;
1796+ whMessageCrypto_Sha2Response res ;
17971797 (void )inSize ;
17981798
17991799 /* Translate the request */
@@ -1839,8 +1839,8 @@ static int _HandleSha224(whServerContext* ctx, uint16_t magic,
18391839
18401840 /* Translate the response */
18411841 if (ret == 0 ) {
1842- ret = wh_MessageCrypto_TranslateSha2Response ( magic , & res ,
1843- cryptoDataOut );
1842+ ret =
1843+ wh_MessageCrypto_TranslateSha2Response ( magic , & res , cryptoDataOut );
18441844 if (ret == 0 ) {
18451845 * outSize = sizeof (res );
18461846 }
@@ -1855,10 +1855,10 @@ static int _HandleSha384(whServerContext* ctx, uint16_t magic,
18551855 const void * cryptoDataIn , uint16_t inSize ,
18561856 void * cryptoDataOut , uint16_t * outSize )
18571857{
1858- int ret = 0 ;
1859- wc_Sha384 sha384 [1 ];
1860- whMessageCrypto_Sha512Request req ;
1861- whMessageCrypto_Sha2Response res ;
1858+ int ret = 0 ;
1859+ wc_Sha384 sha384 [1 ];
1860+ whMessageCrypto_Sha512Request req ;
1861+ whMessageCrypto_Sha2Response res ;
18621862 (void )inSize ;
18631863
18641864 /* Translate the request */
@@ -1908,8 +1908,8 @@ static int _HandleSha384(whServerContext* ctx, uint16_t magic,
19081908
19091909 /* Translate the response */
19101910 if (ret == 0 ) {
1911- ret = wh_MessageCrypto_TranslateSha2Response ( magic , & res ,
1912- cryptoDataOut );
1911+ ret =
1912+ wh_MessageCrypto_TranslateSha2Response ( magic , & res , cryptoDataOut );
19131913 if (ret == 0 ) {
19141914 * outSize = sizeof (res );
19151915 }
@@ -1923,11 +1923,11 @@ static int _HandleSha512(whServerContext* ctx, uint16_t magic,
19231923 const void * cryptoDataIn , uint16_t inSize ,
19241924 void * cryptoDataOut , uint16_t * outSize )
19251925{
1926- int ret = 0 ;
1927- wc_Sha512 sha512 [1 ];
1928- whMessageCrypto_Sha512Request req ;
1929- whMessageCrypto_Sha2Response res ;
1930- int hashType = WC_HASH_TYPE_SHA512 ;
1926+ int ret = 0 ;
1927+ wc_Sha512 sha512 [1 ];
1928+ whMessageCrypto_Sha512Request req ;
1929+ whMessageCrypto_Sha2Response res ;
1930+ int hashType = WC_HASH_TYPE_SHA512 ;
19311931 (void )inSize ;
19321932
19331933 /* Translate the request */
@@ -1937,7 +1937,7 @@ static int _HandleSha512(whServerContext* ctx, uint16_t magic,
19371937 }
19381938 /* init sha2 struct with devid */
19391939 hashType = req .resumeState .hashType ;
1940- switch (hashType ) {
1940+ switch (hashType ) {
19411941 case WC_HASH_TYPE_SHA512_224 :
19421942 ret = wc_InitSha512_224_ex (sha512 , NULL , ctx -> crypto -> devId );
19431943 break ;
@@ -1962,7 +1962,7 @@ static int _HandleSha512(whServerContext* ctx, uint16_t magic,
19621962 ret = wc_Sha512Update (sha512 , req .inBlock , req .lastBlockLen );
19631963 }
19641964 if (ret == 0 ) {
1965- switch (hashType ) {
1965+ switch (hashType ) {
19661966 case WC_HASH_TYPE_SHA512_224 :
19671967 ret = wc_Sha512_224Final (sha512 , res .hash );
19681968 break ;
@@ -1985,14 +1985,13 @@ static int _HandleSha512(whServerContext* ctx, uint16_t magic,
19851985 memcpy (res .hash , sha512 -> digest , WC_SHA512_DIGEST_SIZE );
19861986 res .loLen = sha512 -> loLen ;
19871987 res .hiLen = sha512 -> hiLen ;
1988-
19891988 }
19901989 }
19911990
19921991 /* Translate the response */
19931992 if (ret == 0 ) {
1994- ret = wh_MessageCrypto_TranslateSha2Response ( magic , & res ,
1995- cryptoDataOut );
1993+ ret =
1994+ wh_MessageCrypto_TranslateSha2Response ( magic , & res , cryptoDataOut );
19961995 if (ret == 0 ) {
19971996 * outSize = sizeof (res );
19981997 }
@@ -2543,7 +2542,7 @@ int wh_Server_HandleCryptoRequest(whServerContext* ctx, uint16_t magic,
25432542 break ;
25442543#endif /* !NO_SHA256 */
25452544#if defined(WOLFSSL_SHA224 )
2546- case WC_HASH_TYPE_SHA224 :
2545+ case WC_HASH_TYPE_SHA224 :
25472546#ifdef DEBUG_CRYPTOCB_VERBOSE
25482547 printf ("[server] SHA224 req recv. type:%u\n" ,
25492548 rqstHeader .algoType );
@@ -2558,7 +2557,7 @@ int wh_Server_HandleCryptoRequest(whServerContext* ctx, uint16_t magic,
25582557 break ;
25592558#endif /* WOLFSSL_SHA224 */
25602559#if defined(WOLFSSL_SHA384 )
2561- case WC_HASH_TYPE_SHA384 :
2560+ case WC_HASH_TYPE_SHA384 :
25622561#ifdef DEBUG_CRYPTOCB_VERBOSE
25632562 printf ("[server] SHA384 req recv. type:%u\n" ,
25642563 rqstHeader .algoType );
@@ -2573,7 +2572,7 @@ int wh_Server_HandleCryptoRequest(whServerContext* ctx, uint16_t magic,
25732572 break ;
25742573#endif /* WOLFSSL_SHA384 */
25752574#if defined(WOLFSSL_SHA512 )
2576- case WC_HASH_TYPE_SHA512 :
2575+ case WC_HASH_TYPE_SHA512 :
25772576#ifdef DEBUG_CRYPTOCB_VERBOSE
25782577 printf ("[server] SHA512 req recv. type:%u\n" ,
25792578 rqstHeader .algoType );
@@ -2640,8 +2639,8 @@ static int _HandleSha256Dma(whServerContext* ctx, uint16_t magic, uint16_t seq,
26402639 (void )inSize ;
26412640
26422641 int ret = 0 ;
2643- whMessageCrypto_Sha2DmaRequest req ;
2644- whMessageCrypto_Sha2DmaResponse res ;
2642+ whMessageCrypto_Sha2DmaRequest req ;
2643+ whMessageCrypto_Sha2DmaResponse res ;
26452644 wc_Sha256 sha256 [1 ];
26462645 int clientDevId ;
26472646
@@ -2761,11 +2760,11 @@ static int _HandleSha224Dma(whServerContext* ctx, uint16_t magic, uint16_t seq,
27612760{
27622761 (void )seq ;
27632762 (void )inSize ;
2764- int ret = 0 ;
2763+ int ret = 0 ;
27652764 whMessageCrypto_Sha2DmaRequest req ;
27662765 whMessageCrypto_Sha2DmaResponse res ;
2767- wc_Sha224 sha224 [1 ];
2768- int clientDevId ;
2766+ wc_Sha224 sha224 [1 ];
2767+ int clientDevId ;
27692768
27702769 /* Translate the request */
27712770 ret = wh_MessageCrypto_TranslateSha2DmaRequest (
@@ -2883,11 +2882,11 @@ static int _HandleSha384Dma(whServerContext* ctx, uint16_t magic, uint16_t seq,
28832882{
28842883 (void )seq ;
28852884 (void )inSize ;
2886- int ret = 0 ;
2885+ int ret = 0 ;
28872886 whMessageCrypto_Sha2DmaRequest req ;
28882887 whMessageCrypto_Sha2DmaResponse res ;
2889- wc_Sha384 sha384 [1 ];
2890- int clientDevId ;
2888+ wc_Sha384 sha384 [1 ];
2889+ int clientDevId ;
28912890
28922891 /* Translate the request */
28932892 ret = wh_MessageCrypto_TranslateSha2DmaRequest (
@@ -3005,12 +3004,12 @@ static int _HandleSha512Dma(whServerContext* ctx, uint16_t magic, uint16_t seq,
30053004{
30063005 (void )seq ;
30073006 (void )inSize ;
3008- int ret = 0 ;
3007+ int ret = 0 ;
30093008 whMessageCrypto_Sha2DmaRequest req ;
30103009 whMessageCrypto_Sha2DmaResponse res ;
3011- wc_Sha512 sha512 [1 ];
3012- int clientDevId ;
3013- int hashType = WC_HASH_TYPE_SHA512 ;
3010+ wc_Sha512 sha512 [1 ];
3011+ int clientDevId ;
3012+ int hashType = WC_HASH_TYPE_SHA512 ;
30143013
30153014 /* Translate the request */
30163015 ret = wh_MessageCrypto_TranslateSha2DmaRequest (
@@ -3060,7 +3059,7 @@ static int _HandleSha512Dma(whServerContext* ctx, uint16_t magic, uint16_t seq,
30603059 printf ("[server] wc_Sha512Final: outAddr=%p\n" , outAddr );
30613060 printf ("[server] hashTpe: %d\n" , hashType );
30623061#endif
3063- switch (hashType ) {
3062+ switch (hashType ) {
30643063 case WC_HASH_TYPE_SHA512_224 :
30653064 ret = wc_Sha512_224Final (sha512 , outAddr );
30663065 break ;
0 commit comments