FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/evp.c
/*
 * return an EVP_CIPHER structure when cipher NID is passed.
 *
 * id  cipher NID
 *
 * return WOLFSSL_EVP_CIPHER
*/
return an EVP_CIPHER structure when cipher NID is passed.
id  cipher NID


return an EVP_CIPHER structure when cipher NID is passed . id cipher NID
const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbynid(int id)
{
    WOLFSSL_ENTER("EVP_get_cipherbynid");
    switch(id) {
#ifndef NO_AES
    #ifdef HAVE_AES_CBC
        #ifdef WOLFSSL_AES_128
        case NID_aes_128_cbc:
            return wolfSSL_EVP_aes_128_cbc();
        #endif
        #ifdef WOLFSSL_AES_192
        case NID_aes_192_cbc:
            return wolfSSL_EVP_aes_192_cbc();
        #endif
        #ifdef WOLFSSL_AES_256
        case NID_aes_256_cbc:
            return wolfSSL_EVP_aes_256_cbc();
        #endif
    #endif
    #ifdef WOLFSSL_AES_COUNTER
        #ifdef WOLFSSL_AES_128
        case NID_aes_128_ctr:
            return wolfSSL_EVP_aes_128_ctr();
        #endif
        #ifdef WOLFSSL_AES_192
        case NID_aes_192_ctr:
            return wolfSSL_EVP_aes_192_ctr();
        #endif
        #ifdef WOLFSSL_AES_256
        case NID_aes_256_ctr:
            return wolfSSL_EVP_aes_256_ctr();
        #endif
    #endif 
    #ifdef HAVE_AES_ECB
        #ifdef WOLFSSL_AES_128
        case NID_aes_128_ecb:
            return wolfSSL_EVP_aes_128_ecb();
        #endif
        #ifdef WOLFSSL_AES_192
        case NID_aes_192_ecb:
            return wolfSSL_EVP_aes_192_ecb();
        #endif
        #ifdef WOLFSSL_AES_256
        case NID_aes_256_ecb:
            return wolfSSL_EVP_aes_256_ecb();
        #endif
    #endif 
    #ifdef HAVE_AESGCM
        #ifdef WOLFSSL_AES_128
        case NID_aes_128_gcm:
            return wolfSSL_EVP_aes_128_gcm();
        #endif
        #ifdef WOLFSSL_AES_192
        case NID_aes_192_gcm:
            return wolfSSL_EVP_aes_192_gcm();
        #endif
        #ifdef WOLFSSL_AES_256
        case NID_aes_256_gcm:
            return wolfSSL_EVP_aes_256_gcm();
        #endif
    #endif
#endif
#ifndef NO_DES3
        case NID_des_cbc:
            return wolfSSL_EVP_des_cbc();
#ifdef WOLFSSL_DES_ECB
        case NID_des_ecb:
            return wolfSSL_EVP_des_ecb();
#endif
        case NID_des_ede3_cbc:
            return wolfSSL_EVP_des_ede3_cbc();
#ifdef WOLFSSL_DES_ECB
        case NID_des_ede3_ecb:
            return wolfSSL_EVP_des_ede3_ecb();
#endif
#endif 
#ifdef HAVE_IDEA
        case NID_idea_cbc:
            return wolfSSL_EVP_idea_cbc();
#endif
        default:
            WOLFSSL_MSG("Bad cipher id value");
    }
    return NULL;
}
const WOLFSSL_EVP_CIPHER * wolfSSL_EVP_get_cipherbynid ( int id ) { WOLFSSL_ENTER ( " " ) ; switch ( id ) { #ifndef NO_AES #ifdef HAVE_AES_CBC #ifdef WOLFSSL_AES_128 case NID_aes_128_cbc : return wolfSSL_EVP_aes_128_cbc ( ) ; #endif #ifdef WOLFSSL_AES_192 case NID_aes_192_cbc : return wolfSSL_EVP_aes_192_cbc ( ) ; #endif #ifdef WOLFSSL_AES_256 case NID_aes_256_cbc : return wolfSSL_EVP_aes_256_cbc ( ) ; #endif #endif #ifdef WOLFSSL_AES_COUNTER #ifdef WOLFSSL_AES_128 case NID_aes_128_ctr : return wolfSSL_EVP_aes_128_ctr ( ) ; #endif #ifdef WOLFSSL_AES_192 case NID_aes_192_ctr : return wolfSSL_EVP_aes_192_ctr ( ) ; #endif #ifdef WOLFSSL_AES_256 case NID_aes_256_ctr : return wolfSSL_EVP_aes_256_ctr ( ) ; #endif #endif #ifdef HAVE_AES_ECB #ifdef WOLFSSL_AES_128 case NID_aes_128_ecb : return wolfSSL_EVP_aes_128_ecb ( ) ; #endif #ifdef WOLFSSL_AES_192 case NID_aes_192_ecb : return wolfSSL_EVP_aes_192_ecb ( ) ; #endif #ifdef WOLFSSL_AES_256 case NID_aes_256_ecb : return wolfSSL_EVP_aes_256_ecb ( ) ; #endif #endif #ifdef HAVE_AESGCM #ifdef WOLFSSL_AES_128 case NID_aes_128_gcm : return wolfSSL_EVP_aes_128_gcm ( ) ; #endif #ifdef WOLFSSL_AES_192 case NID_aes_192_gcm : return wolfSSL_EVP_aes_192_gcm ( ) ; #endif #ifdef WOLFSSL_AES_256 case NID_aes_256_gcm : return wolfSSL_EVP_aes_256_gcm ( ) ; #endif #endif #endif #ifndef NO_DES3 case NID_des_cbc : return wolfSSL_EVP_des_cbc ( ) ; #ifdef WOLFSSL_DES_ECB case NID_des_ecb : return wolfSSL_EVP_des_ecb ( ) ; #endif case NID_des_ede3_cbc : return wolfSSL_EVP_des_ede3_cbc ( ) ; #ifdef WOLFSSL_DES_ECB case NID_des_ede3_ecb : return wolfSSL_EVP_des_ede3_ecb ( ) ; #endif #endif #ifdef HAVE_IDEA case NID_idea_cbc : return wolfSSL_EVP_idea_cbc ( ) ; #endif default : WOLFSSL_MSG ( " " ) ; } return NULL ; }
return an EVP_CIPHER structure when cipher NID is passed.
return an EVP_CIPHER structure when cipher NID is passed .
/* WOLFSSL_AES_COUNTER */ /* HAVE_AES_ECB */ /*NO_DES3*/