FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/evp.c
/* Get the length of the mac based on the digest algorithm. */
Get the length of the mac based on the digest algorithm.
Get the length of the mac based on the digest algorithm .
static int wolfssl_mac_len(unsigned char macType)
{
    int hashLen;
    switch (macType) {
    #ifndef NO_MD5
        case WC_MD5:
            hashLen = WC_MD5_DIGEST_SIZE;
            break;
    #endif 
    #ifndef NO_SHA
        case WC_SHA:
            hashLen = WC_SHA_DIGEST_SIZE;
            break;
    #endif 
    #ifdef WOLFSSL_SHA224
        case WC_SHA224:
            hashLen = WC_SHA224_DIGEST_SIZE;
            break;
    #endif 
    #ifndef NO_SHA256
        case WC_SHA256:
            hashLen = WC_SHA256_DIGEST_SIZE;
            break;
    #endif 
    #ifdef WOLFSSL_SHA384
        case WC_SHA384:
            hashLen = WC_SHA384_DIGEST_SIZE;
            break;
    #endif 
    #ifdef WOLFSSL_SHA512
        case WC_SHA512:
            hashLen = WC_SHA512_DIGEST_SIZE;
            break;
    #endif 
    #ifdef HAVE_BLAKE2
        case BLAKE2B_ID:
            hashLen = BLAKE2B_OUTBYTES;
            break;
    #endif 
        default:
            hashLen = 0;
    }
    return hashLen;
}
static int wolfssl_mac_len ( unsigned char macType ) { int hashLen ; switch ( macType ) { #ifndef NO_MD5 case WC_MD5 : hashLen = WC_MD5_DIGEST_SIZE ; break ; #endif #ifndef NO_SHA case WC_SHA : hashLen = WC_SHA_DIGEST_SIZE ; break ; #endif #ifdef WOLFSSL_SHA224 case WC_SHA224 : hashLen = WC_SHA224_DIGEST_SIZE ; break ; #endif #ifndef NO_SHA256 case WC_SHA256 : hashLen = WC_SHA256_DIGEST_SIZE ; break ; #endif #ifdef WOLFSSL_SHA384 case WC_SHA384 : hashLen = WC_SHA384_DIGEST_SIZE ; break ; #endif #ifdef WOLFSSL_SHA512 case WC_SHA512 : hashLen = WC_SHA512_DIGEST_SIZE ; break ; #endif #ifdef HAVE_BLAKE2 case BLAKE2B_ID : hashLen = BLAKE2B_OUTBYTES ; break ; #endif default : hashLen = 0 ; } return hashLen ; }
Get the length of the mac based on the digest algorithm.
Get the length of the mac based on the digest algorithm .
/* !NO_MD5 */ /* !NO_SHA */ /* WOLFSSL_SHA224 */ /* !NO_SHA256 */ /* WOLFSSL_SHA384 */ /* WOLFSSL_SHA512 */ /* HAVE_BLAKE2 */