pub unsafe extern "C" fn mbedtls_rsa_rsaes_pkcs1_v15_decrypt(
    ctx: *mut mbedtls_rsa_context,
    f_rng: Option<unsafe extern "C" fn(_: *mut c_void, _: *mut u8, _: usize) -> i32>,
    p_rng: *mut c_void,
    olen: *mut usize,
    input: *const u8,
    output: *mut u8,
    output_max_len: usize,
) -> i32
Expand description

\brief This function performs a PKCS#1 v1.5 decryption operation (RSAES-PKCS1-v1_5-DECRYPT).

\warning This is an inherently dangerous function (CWE-242). Unless it is used in a side channel free and safe way (eg. implementing the TLS protocol as per 7.4.7.1 of RFC 5246), the calling code is vulnerable.

\note The output buffer length \c output_max_len should be as large as the size \p ctx->len of \p ctx->N, for example, 128 Bytes if RSA-1024 is used, to be able to hold an arbitrary decrypted message. If it is not large enough to hold the decryption of the particular ciphertext provided, the function returns #MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE.

\param ctx The initialized RSA context to use. \param f_rng The RNG function. This is used for blinding and is mandatory; see mbedtls_rsa_private() for more. \param p_rng The RNG context to be passed to \p f_rng. This may be \c NULL if \p f_rng doesn’t need a context. \param olen The address at which to store the length of the plaintext. This must not be \c NULL. \param input The ciphertext buffer. This must be a readable buffer of length \c ctx->len Bytes. For example, \c 256 Bytes for an 2048-bit RSA modulus. \param output The buffer used to hold the plaintext. This must be a writable buffer of length \p output_max_len Bytes. \param output_max_len The length in Bytes of the output buffer \p output.

\return \c 0 on success. \return An \c MBEDTLS_ERR_RSA_XXX error code on failure.