[][src]Function hactool_sys::mbedtls_cipher_crypt

pub unsafe extern "C" fn mbedtls_cipher_crypt(
    ctx: *mut mbedtls_cipher_context_t,
    iv: *const c_uchar,
    iv_len: usize,
    input: *const c_uchar,
    ilen: usize,
    output: *mut c_uchar,
    olen: *mut usize
) -> c_int

\brief Generic all-in-one encryption/decryption (for all ciphers except AEAD constructs).

\param ctx generic cipher context \param iv IV to use (or NONCE_COUNTER for CTR-mode ciphers) \param iv_len IV length for ciphers with variable-size IV; discarded by ciphers with fixed-size IV. \param input buffer holding the input data \param ilen length of the input data \param output buffer for the output data. Should be able to hold at least ilen + block_size. Cannot be the same buffer as input! \param olen length of the output data, will be filled with the actual number of bytes written.

\note Some ciphers don't use IVs nor NONCE. For these ciphers, use iv = NULL and iv_len = 0.

\returns 0 on success, or MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA, or MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED if decryption expected a full block but was not provided one, or MBEDTLS_ERR_CIPHER_INVALID_PADDING on invalid padding while decrypting, or a cipher specific error code.