XTS mode
Currently working on the implementation of XTS. I might have to do a bunch of hacks and not use some traits for now because XTS uses two engines (one to encrypt the teak and one to encrypt the data), which does not seems to be compatible with the current traits. I'm currently investigating.
~~Idea 1: The second engine is only used once on the IV/Tweak at the start of the encryption/decryption, so it could be processed before creating the block cipher using a custom function. This seems to be the easiest method for now so I'll go with that, although it makes the API pretty ugly~~
EDIT: Found my way around the traits and I've been able to implement this correctly
My work is being tracked here: https://github.com/zer0x64/block-modes/tree/xts
~~For now, I've implemented a custom new_xts method on Encryptor and Decryptor that accepts two keys. Unfortunately I don't think I can "Block" trait blanket implementations for KeyIvInit to make it harder to misuse. Still investigating.~~
Next hurdle is the ciphertext stealing part. The cts crate does all the work in BlockCipherEnc/DecClosure, which doesn't work for a parallellized implementation I think. My guess is that's I'll have to override implementations of BlockModeEnc/DecClosure?
PR opened in draft: https://github.com/RustCrypto/block-modes/pull/74