@@ -5709,7 +5709,7 @@ int wh_Client_Sha384DmaUpdateRequest(whClientContext* ctx, wc_Sha384* sha,
57095709 memcpy (req -> resumeState .hash , sha -> digest , WC_SHA512_DIGEST_SIZE );
57105710 req -> resumeState .hiLen = sha -> hiLen ;
57115711 req -> resumeState .loLen = sha -> loLen ;
5712- req -> resumeState .hashType = sha -> hashType ;
5712+ req -> resumeState .hashType = WC_HASH_TYPE_SHA384 ;
57135713 req -> input .sz = dmaSz ;
57145714 req -> input .addr = 0 ;
57155715
@@ -5817,7 +5817,7 @@ int wh_Client_Sha384DmaFinalRequest(whClientContext* ctx, wc_Sha384* sha)
58175817 memcpy (req -> resumeState .hash , sha -> digest , WC_SHA512_DIGEST_SIZE );
58185818 req -> resumeState .hiLen = sha -> hiLen ;
58195819 req -> resumeState .loLen = sha -> loLen ;
5820- req -> resumeState .hashType = sha -> hashType ;
5820+ req -> resumeState .hashType = WC_HASH_TYPE_SHA384 ;
58215821 req -> input .sz = 0 ;
58225822 req -> input .addr = 0 ;
58235823
@@ -6117,14 +6117,18 @@ int wh_Client_Sha512FinalResponse(whClientContext* ctx, wc_Sha512* sha,
61176117 /* reset the state of the sha context (without blowing away devId and
61186118 * hashType), and copy only the digest bytes for the active variant */
61196119 switch (hashType ) {
6120+ #ifndef WOLFSSL_NOSHA512_224
61206121 case WC_HASH_TYPE_SHA512_224 :
61216122 memcpy (out , res -> hash , WC_SHA512_224_DIGEST_SIZE );
61226123 (void )wc_InitSha512_224_ex (sha , NULL , sha -> devId );
61236124 break ;
6125+ #endif
6126+ #ifndef WOLFSSL_NOSHA512_256
61246127 case WC_HASH_TYPE_SHA512_256 :
61256128 memcpy (out , res -> hash , WC_SHA512_256_DIGEST_SIZE );
61266129 (void )wc_InitSha512_256_ex (sha , NULL , sha -> devId );
61276130 break ;
6131+ #endif
61286132 default :
61296133 memcpy (out , res -> hash , WC_SHA512_DIGEST_SIZE );
61306134 (void )wc_InitSha512_ex (sha , NULL , sha -> devId );
@@ -6408,14 +6412,18 @@ int wh_Client_Sha512DmaFinalResponse(whClientContext* ctx, wc_Sha512* sha,
64086412 * and hashType), and copy only the digest bytes for the active
64096413 * variant */
64106414 switch (hashType ) {
6415+ #ifndef WOLFSSL_NOSHA512_224
64116416 case WC_HASH_TYPE_SHA512_224 :
64126417 memcpy (out , resp -> hash , WC_SHA512_224_DIGEST_SIZE );
64136418 (void )wc_InitSha512_224_ex (sha , NULL , sha -> devId );
64146419 break ;
6420+ #endif
6421+ #ifndef WOLFSSL_NOSHA512_256
64156422 case WC_HASH_TYPE_SHA512_256 :
64166423 memcpy (out , resp -> hash , WC_SHA512_256_DIGEST_SIZE );
64176424 (void )wc_InitSha512_256_ex (sha , NULL , sha -> devId );
64186425 break ;
6426+ #endif
64196427 default :
64206428 memcpy (out , resp -> hash , WC_SHA512_DIGEST_SIZE );
64216429 (void )wc_InitSha512_ex (sha , NULL , sha -> devId );
0 commit comments