FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/evp.c
/* this function makes the assumption that out buffer is big enough for digest*/
this function makes the assumption that out buffer is big enough for digest
this function makes the assumption that out buffer is big enough for digest
int wolfSSL_EVP_Digest(const unsigned char* in, int inSz, unsigned char* out,
                              unsigned int* outSz, const WOLFSSL_EVP_MD* evp,
                              WOLFSSL_ENGINE* eng)
{
    int err;
    int hashType = WC_HASH_TYPE_NONE;
    int hashSz;
    WOLFSSL_ENTER("wolfSSL_EVP_Digest");
    if (in == NULL || out == NULL || evp == NULL) {
        WOLFSSL_MSG("Null argument passed in");
        return WOLFSSL_FAILURE;
    }
    err = wolfSSL_EVP_get_hashinfo(evp, &hashType, &hashSz);
    if (err != WOLFSSL_SUCCESS)
        return err;
    if (wc_Hash((enum wc_HashType)hashType, in, inSz, out, hashSz) != 0) {
        return WOLFSSL_FAILURE;
    }
    if (outSz != NULL)
        *outSz = hashSz;
    (void)eng;
    return WOLFSSL_SUCCESS;
}
int wolfSSL_EVP_Digest ( const unsigned char * in , int inSz , unsigned char * out , unsigned int * outSz , const WOLFSSL_EVP_MD * evp , WOLFSSL_ENGINE * eng ) { int err ; int hashType = WC_HASH_TYPE_NONE ; int hashSz ; WOLFSSL_ENTER ( " " ) ; if ( in == NULL || out == NULL || evp == NULL ) { WOLFSSL_MSG ( " " ) ; return WOLFSSL_FAILURE ; } err = wolfSSL_EVP_get_hashinfo ( evp , & hashType , & hashSz ) ; if ( err != WOLFSSL_SUCCESS ) return err ; if ( wc_Hash ( ( enum wc_HashType ) hashType , in , inSz , out , hashSz ) != 0 ) { return WOLFSSL_FAILURE ; } if ( outSz != NULL ) * outSz = hashSz ; ( void ) eng ; return WOLFSSL_SUCCESS ; }
this function makes the assumption that out buffer is big enough for digest
this function makes the assumption that out buffer is big enough for digest