FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/evp.c
/* Getter function for cipher key length
 *
 * c  WOLFSSL_EVP_CIPHER structure to get key length from
 *
 * NOTE: OpenSSL_add_all_ciphers() should be called first before using this
 *       function
 *
 * Returns size of key in bytes
 */
Getter function for cipher key length
c  WOLFSSL_EVP_CIPHER structure to get key length from

OpenSSL_add_all_ciphers() should be called first before using this
function

Returns size of key in bytes
Getter function for cipher key length c WOLFSSL_EVP_CIPHER structure to get key length from OpenSSL_add_all_ciphers () should be called first before using this function Returns size of key in bytes
int wolfSSL_EVP_Cipher_key_length(const WOLFSSL_EVP_CIPHER* c)
{
    WOLFSSL_ENTER("wolfSSL_EVP_Cipher_key_length");
    if (c == NULL) {
        return 0;
    }
    switch (cipherType(c)) {
#if !defined(NO_AES)
  #if defined(HAVE_AES_CBC)
      case AES_128_CBC_TYPE: return 16;
      case AES_192_CBC_TYPE: return 24;
      case AES_256_CBC_TYPE: return 32;
  #endif
  #if defined(WOLFSSL_AES_CFB)
      case AES_128_CFB1_TYPE: return 16;
      case AES_192_CFB1_TYPE: return 24;
      case AES_256_CFB1_TYPE: return 32;
      case AES_128_CFB8_TYPE: return 16;
      case AES_192_CFB8_TYPE: return 24;
      case AES_256_CFB8_TYPE: return 32;
      case AES_128_CFB128_TYPE: return 16;
      case AES_192_CFB128_TYPE: return 24;
      case AES_256_CFB128_TYPE: return 32;
  #endif
  #if defined(WOLFSSL_AES_OFB)
      case AES_128_OFB_TYPE: return 16;
      case AES_192_OFB_TYPE: return 24;
      case AES_256_OFB_TYPE: return 32;
  #endif
  #if defined(WOLFSSL_AES_XTS)
      case AES_128_XTS_TYPE: return 16;
      case AES_256_XTS_TYPE: return 32;
  #endif
  #if defined(HAVE_AESGCM)
      case AES_128_GCM_TYPE: return 16;
      case AES_192_GCM_TYPE: return 24;
      case AES_256_GCM_TYPE: return 32;
  #endif
  #if defined(WOLFSSL_AES_COUNTER)
      case AES_128_CTR_TYPE: return 16;
      case AES_192_CTR_TYPE: return 24;
      case AES_256_CTR_TYPE: return 32;
  #endif
  #if defined(HAVE_AES_ECB)
      case AES_128_ECB_TYPE: return 16;
      case AES_192_ECB_TYPE: return 24;
      case AES_256_ECB_TYPE: return 32;
  #endif
#endif 
  #ifndef NO_DES3
      case DES_CBC_TYPE:      return 8;
      case DES_EDE3_CBC_TYPE: return 24;
      case DES_ECB_TYPE:      return 8;
      case DES_EDE3_ECB_TYPE: return 24;
  #endif
      default:
          return 0;
      }
}
int wolfSSL_EVP_Cipher_key_length ( const WOLFSSL_EVP_CIPHER * c ) { WOLFSSL_ENTER ( " " ) ; if ( c == NULL ) { return 0 ; } switch ( cipherType ( c ) ) { #if ! defined ( NO_AES ) #if defined ( HAVE_AES_CBC ) case AES_128_CBC_TYPE : return 16 ; case AES_192_CBC_TYPE : return 24 ; case AES_256_CBC_TYPE : return 32 ; #endif #if defined ( WOLFSSL_AES_CFB ) case AES_128_CFB1_TYPE : return 16 ; case AES_192_CFB1_TYPE : return 24 ; case AES_256_CFB1_TYPE : return 32 ; case AES_128_CFB8_TYPE : return 16 ; case AES_192_CFB8_TYPE : return 24 ; case AES_256_CFB8_TYPE : return 32 ; case AES_128_CFB128_TYPE : return 16 ; case AES_192_CFB128_TYPE : return 24 ; case AES_256_CFB128_TYPE : return 32 ; #endif #if defined ( WOLFSSL_AES_OFB ) case AES_128_OFB_TYPE : return 16 ; case AES_192_OFB_TYPE : return 24 ; case AES_256_OFB_TYPE : return 32 ; #endif #if defined ( WOLFSSL_AES_XTS ) case AES_128_XTS_TYPE : return 16 ; case AES_256_XTS_TYPE : return 32 ; #endif #if defined ( HAVE_AESGCM ) case AES_128_GCM_TYPE : return 16 ; case AES_192_GCM_TYPE : return 24 ; case AES_256_GCM_TYPE : return 32 ; #endif #if defined ( WOLFSSL_AES_COUNTER ) case AES_128_CTR_TYPE : return 16 ; case AES_192_CTR_TYPE : return 24 ; case AES_256_CTR_TYPE : return 32 ; #endif #if defined ( HAVE_AES_ECB ) case AES_128_ECB_TYPE : return 16 ; case AES_192_ECB_TYPE : return 24 ; case AES_256_ECB_TYPE : return 32 ; #endif #endif #ifndef NO_DES3 case DES_CBC_TYPE : return 8 ; case DES_EDE3_CBC_TYPE : return 24 ; case DES_ECB_TYPE : return 8 ; case DES_EDE3_ECB_TYPE : return 24 ; #endif default : return 0 ; } }
Getter function for cipher key length
 c  WOLFSSL_EVP_CIPHER structure to get key length from
Getter function for cipher key length c WOLFSSL_EVP_CIPHER structure to get key length from
/* !NO_AES */