Function aes_frast::aes_with_operation_mode::cbc_dec [] [src]

pub fn cbc_dec(
    cipher: &[u8],
    plain: &mut [u8],
    keys: &[u32],
    iv: &[u8]
) -> Vec<u8>

CBC (Cipher Block Chaining) Decryption

This function decrypts a long cipher from the first parameter and put the long plain into the second parameter, using the scheduled keys and the initialization vector (IV) in the third and fourth parameters.
Finally, it returns the final block of the cipher (NOT the plain).
CBC decryption (This picture comes from the Wikimedia Commons)

Examples

Please refer to the cbc_enc function, codes are included there.