Function aes_frast::aes_with_operation_mode::pcbc_dec [] [src]

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

PCBC (Propagating Cipher Block Chaining) Decryption (Experimental)

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 XOR result of the final block of the cipher and the final block of the plain. PCBC decryption (This picture comes from the Wikimedia Commons)
[Attention!] On a message encrypted in PCBC mode, if two adjacent ciphertext blocks are exchanged, this does not affect the decryption of subsequent blocks.

Examples

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