Function esp_idf_sys::mbedtls_rsa_pkcs1_encrypt

source ·
pub unsafe extern "C" fn mbedtls_rsa_pkcs1_encrypt(
    ctx: *mut mbedtls_rsa_context,
    f_rng: Option<unsafe extern "C" fn(arg1: *mut c_void, arg2: *mut c_uchar, arg3: usize) -> c_int>,
    p_rng: *mut c_void,
    ilen: usize,
    input: *const c_uchar,
    output: *mut c_uchar,
) -> c_int
Expand description

\brief This function adds the message padding, then performs an RSA operation.

            It is the generic wrapper for performing a PKCS#1 encryption
            operation.

\param ctx The initialized RSA context to use. \param f_rng The RNG to use. It is used for padding generation and it is mandatory. \param p_rng The RNG context to be passed to \p f_rng. May be \c NULL if \p f_rng doesn’t need a context argument. \param ilen The length of the plaintext in Bytes. \param input The input data to encrypt. This must be a readable buffer of size \p ilen Bytes. It may be \c NULL if ilen == 0. \param output The output buffer. This must be a writable buffer of length \c ctx->len Bytes. For example, \c 256 Bytes for an 2048-bit RSA modulus.

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