FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/sha3.c
/* Calculate the SHA-3 hash based on all the message data seen.
 *
 * sha3  wc_Sha3 object holding state.
 * hash  Buffer to hold the hash result.
 * p     Number of 64-bit numbers in a block of data to process.
 * len   Number of bytes in output.
 * returns 0 on success.
 */
Calculate the SHA-3 hash based on all the message data seen.
sha3  wc_Sha3 object holding state.
hash  Buffer to hold the hash result.
p     Number of 64-bit numbers in a block of data to process.
len   Number of bytes in output.
returns 0 on success.
Calculate the SHA - 3 hash based on all the message data seen . sha3 wc_Sha3 object holding state . hash Buffer to hold the hash result . p Number of 64 - bit numbers in a block of data to process . len Number of bytes in output . returns 0 on success .
static int wc_Sha3Final(wc_Sha3* sha3, byte* hash, byte p, byte len)
{
    int ret;
    if (sha3 == NULL || hash == NULL) {
        return BAD_FUNC_ARG;
    }
#if defined(WOLFSSL_ASYNC_CRYPT) && defined(WC_ASYNC_ENABLE_SHA3)
    if (sha3->asyncDev.marker == WOLFSSL_ASYNC_MARKER_SHA3) {
    #if defined(HAVE_INTEL_QA) && defined(QAT_V2)
        if (len == WC_SHA3_256_DIGEST_SIZE) {
            ret = IntelQaSymSha3(&sha3->asyncDev, hash, NULL, len);
            if (ret != NOT_COMPILED_IN)
                return ret;
        }
    #endif
    }
#endif 
    ret = Sha3Final(sha3, 0x06, hash, p, len);
    if (ret != 0)
        return ret;
    return InitSha3(sha3);  
}
static int wc_Sha3Final ( wc_Sha3 * sha3 , byte * hash , byte p , byte len ) { int ret ; if ( sha3 == NULL || hash == NULL ) { return BAD_FUNC_ARG ; } #if defined ( WOLFSSL_ASYNC_CRYPT ) && defined ( WC_ASYNC_ENABLE_SHA3 ) if ( sha3 -> asyncDev . marker == WOLFSSL_ASYNC_MARKER_SHA3 ) { #if defined ( HAVE_INTEL_QA ) && defined ( QAT_V2 ) if ( len == WC_SHA3_256_DIGEST_SIZE ) { ret = IntelQaSymSha3 ( & sha3 -> asyncDev , hash , NULL , len ) ; if ( ret != NOT_COMPILED_IN ) return ret ; } #endif } #endif ret = Sha3Final ( sha3 , 0x06 , hash , p , len ) ; if ( ret != 0 ) return ret ; return InitSha3 ( sha3 ) ; }
Calculate the SHA-3 hash based on all the message data seen.
Calculate the SHA - 3 hash based on all the message data seen .
/* QAT only supports SHA3_256 */ /* QAT SHA-3 only supported on v2 (8970 or later cards) */ /* fall-through when unavailable */ /* WOLFSSL_ASYNC_CRYPT */ /* reset state */