FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/sha3.c
/* Update the SHA-3 hash state with message data.
 *
 * sha3  wc_Sha3 object holding state.
 * data  Message data to be hashed.
 * len   Length of the message data.
 * p     Number of 64-bit numbers in a block of data to process.
 * returns 0 on success.
 */
Update the SHA-3 hash state with message data.
sha3  wc_Sha3 object holding state.
data  Message data to be hashed.
len   Length of the message data.
p     Number of 64-bit numbers in a block of data to process.
returns 0 on success.
Update the SHA - 3 hash state with message data . sha3 wc_Sha3 object holding state . data Message data to be hashed . len Length of the message data . p Number of 64 - bit numbers in a block of data to process . returns 0 on success .
static int wc_Sha3Update(wc_Sha3* sha3, const byte* data, word32 len, byte p)
{
    int ret;
    if (sha3 == NULL || (data == NULL && len > 0)) {
        return BAD_FUNC_ARG;
    }
    if (data == NULL && len == 0) {
        return 0;
    }
#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 (p == WC_SHA3_256_COUNT) {
            ret = IntelQaSymSha3(&sha3->asyncDev, NULL, data, len);
            if (ret != NOT_COMPILED_IN)
                return ret;
        }
    #endif
    }
#endif 
    ret = Sha3Update(sha3, data, len, p);
    return ret;
}
static int wc_Sha3Update ( wc_Sha3 * sha3 , const byte * data , word32 len , byte p ) { int ret ; if ( sha3 == NULL || ( data == NULL && len > 0 ) ) { return BAD_FUNC_ARG ; } if ( data == NULL && len == 0 ) { return 0 ; } #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 ( p == WC_SHA3_256_COUNT ) { ret = IntelQaSymSha3 ( & sha3 -> asyncDev , NULL , data , len ) ; if ( ret != NOT_COMPILED_IN ) return ret ; } #endif } #endif ret = Sha3Update ( sha3 , data , len , p ) ; return ret ; }
Update the SHA-3 hash state with message data.
Update the SHA - 3 hash state with message data .
/* valid, but do nothing */ /* QAT only supports SHA3_256 */ /* fall-through when unavailable */ /* WOLFSSL_ASYNC_CRYPT */