Function esp_idf_sys::mbedtls_pk_encrypt

source ยท
pub unsafe extern "C" fn mbedtls_pk_encrypt(
    ctx: *mut mbedtls_pk_context,
    input: *const c_uchar,
    ilen: usize,
    output: *mut c_uchar,
    olen: *mut usize,
    osize: usize,
    f_rng: Option<unsafe extern "C" fn(arg1: *mut c_void, arg2: *mut c_uchar, arg3: usize) -> c_int>,
    p_rng: *mut c_void,
) -> c_int
Expand description

\brief Encrypt message (including padding if relevant).

\param ctx The PK context to use. It must have been set up. \param input Message to encrypt \param ilen Message size \param output Encrypted output \param olen Encrypted output length \param osize Size of the output buffer \param f_rng RNG function, must not be \c NULL. \param p_rng RNG parameter

\note For keys of type #MBEDTLS_PK_RSA, the signature algorithm is either PKCS#1 v1.5 or OAEP, depending on the padding mode in the underlying RSA context. For a pk object constructed by parsing, this is PKCS#1 v1.5 by default.

\note \p f_rng is used for padding generation.

\return 0 on success, or a specific error code.