/// generated using the code in: https://www.ietf.org/archive/id/draft-krovetz-rc6-rc5-vectors-00.txt
#[cfg(test)]
#[allow(deprecated)] // uses `clone_from_slice`
mod tests {
    use cipher::consts::*;
    use cipher::{BlockCipherDecrypt, BlockCipherEncrypt, KeyInit, array::Array};
    use rc6::RC6;

    #[test]
    fn enc_dec_8_12_4() {
        let key = [0x00, 0x01, 0x02, 0x03];

        let pt = [0x00, 0x01, 0x02, 0x03];
        let ct = [0xAE, 0xFC, 0x46, 0x12];

        let rc6 = <RC6<u8, U12, U4> as KeyInit>::new_from_slice(&key).unwrap();

        let mut block = Array::clone_from_slice(&pt);
        rc6.encrypt_block(&mut block);

        assert_eq!(ct, block[..]);

        rc6.decrypt_block(&mut block);
        assert_eq!(pt, block[..]);
    }

    #[test]
    fn enc_dec_16_16_8() {
        let key = [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07];

        let pt = [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07];
        let ct = [0x2F, 0xF0, 0xB6, 0x8E, 0xAE, 0xFF, 0xAD, 0x5B];

        let rc6 = <RC6<u16, U16, U8> as KeyInit>::new_from_slice(&key).unwrap();
        let mut block = Array::clone_from_slice(&pt);
        rc6.encrypt_block(&mut block);

        assert_eq!(ct, block[..]);

        rc6.decrypt_block(&mut block);
        assert_eq!(pt, block[..]);
    }

    #[test]
    fn enc_dec_32_20_16() {
        let key = [
            0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
            0x0E, 0x0F,
        ];

        let pt = [
            0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
            0x0E, 0x0F,
        ];
        let ct = [
            0x3A, 0x96, 0xF9, 0xC7, 0xF6, 0x75, 0x5C, 0xFE, 0x46, 0xF0, 0x0E, 0x3D, 0xCD, 0x5D,
            0x2A, 0x3C,
        ];

        let rc6 = <RC6<u32, U20, U16> as KeyInit>::new_from_slice(&key).unwrap();
        let mut block = Array::clone_from_slice(&pt);
        rc6.encrypt_block(&mut block);

        assert_eq!(ct, block[..]);

        rc6.decrypt_block(&mut block);
        assert_eq!(pt, block[..]);
    }

    #[test]
    fn enc_dec_64_24_24() {
        let key = [
            0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
            0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
        ];

        let pt = [
            0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
            0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B,
            0x1C, 0x1D, 0x1E, 0x1F,
        ];
        let ct = [
            0xC0, 0x02, 0xDE, 0x05, 0x0B, 0xD5, 0x5E, 0x5D, 0x36, 0x86, 0x4A, 0xB9, 0x85, 0x33,
            0x38, 0xE6, 0xDC, 0x4A, 0x13, 0x26, 0xC6, 0xBD, 0xAA, 0xEB, 0x1B, 0xC9, 0xE4, 0xFD,
            0x67, 0x88, 0x66, 0x17,
        ];

        let rc6 = <RC6<u64, U24, U24> as KeyInit>::new_from_slice(&key).unwrap();
        let mut block = Array::clone_from_slice(&pt);
        rc6.encrypt_block(&mut block);

        assert_eq!(ct, block[..]);

        rc6.decrypt_block(&mut block);
        assert_eq!(pt, block[..]);
    }
}
