FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/evp.c
/* Uses the WOLFSSL_EVP_PKEY_CTX to decrypt a buffer.
 *
 * ctx    structure to decrypt with
 * out    buffer to hold the results
 * outlen initially holds size of out buffer and gets set to decrypt result size
 * in     buffer decrypt
 * inlen  length of in buffer
 *
 * returns WOLFSSL_SUCCESS on success.
 */
Uses the WOLFSSL_EVP_PKEY_CTX to decrypt a buffer.
ctx    structure to decrypt with
out    buffer to hold the results
outlen initially holds size of out buffer and gets set to decrypt result size
in     buffer decrypt
inlen  length of in buffer

returns WOLFSSL_SUCCESS on success.
Uses the WOLFSSL_EVP_PKEY_CTX to decrypt a buffer . ctx structure to decrypt with out buffer to hold the results outlen initially holds size of out buffer and gets set to decrypt result size in buffer decrypt inlen length of in buffer returns WOLFSSL_SUCCESS on success .
int wolfSSL_EVP_PKEY_decrypt(WOLFSSL_EVP_PKEY_CTX *ctx,
                     unsigned char *out, size_t *outlen,
                     const unsigned char *in, size_t inlen)
{
    int len = 0;
    if (ctx == NULL) return 0;
    WOLFSSL_ENTER("EVP_PKEY_decrypt");
    (void)out;
    (void)outlen;
    (void)in;
    (void)inlen;
    (void)len;
    switch (ctx->pkey->type) {
#if !defined(NO_RSA) && !defined(HAVE_USER_RSA)
    case EVP_PKEY_RSA:
        len = wolfSSL_RSA_private_decrypt((int)inlen, (unsigned char*)in, out,
              ctx->pkey->rsa, ctx->padding);
        if (len < 0) break;
        else {
            *outlen = len;
            return WOLFSSL_SUCCESS;
        }
#endif 
    case EVP_PKEY_EC:
        WOLFSSL_MSG("not implemented");
        FALL_THROUGH;
    default:
        break;
    }
    return WOLFSSL_FAILURE;
}
int wolfSSL_EVP_PKEY_decrypt ( WOLFSSL_EVP_PKEY_CTX * ctx , unsigned char * out , size_t * outlen , const unsigned char * in , size_t inlen ) { int len = 0 ; if ( ctx == NULL ) return 0 ; WOLFSSL_ENTER ( " " ) ; ( void ) out ; ( void ) outlen ; ( void ) in ; ( void ) inlen ; ( void ) len ; switch ( ctx -> pkey -> type ) { #if ! defined ( NO_RSA ) && ! defined ( HAVE_USER_RSA ) case EVP_PKEY_RSA : len = wolfSSL_RSA_private_decrypt ( ( int ) inlen , ( unsigned char * ) in , out , ctx -> pkey -> rsa , ctx -> padding ) ; if ( len < 0 ) break ; else { * outlen = len ; return WOLFSSL_SUCCESS ; } #endif case EVP_PKEY_EC : WOLFSSL_MSG ( " " ) ; FALL_THROUGH ; default : break ; } return WOLFSSL_FAILURE ; }
Uses the WOLFSSL_EVP_PKEY_CTX to decrypt a buffer.
Uses the WOLFSSL_EVP_PKEY_CTX to decrypt a buffer .
/* NO_RSA */