RustCrypto / block-modes

Collection of generic block mode algorithms written in pure Rust
64 stars 13 forks source link

XTS Mode #74

Open zer0x64 opened 1 week ago

zer0x64 commented 1 week ago

I implemented the trait on the pre release of cipher.

Suggestions for the cipher crate:

Missing:

If you've got any suggestion for the first point, it would be appreciated!

zer0x64 commented 1 week ago

Okay, I found the underlying issue: BlockModeEncrypt/Decrypt simply does not support encrypting/decrypting data that's not aligned to a block without using padding. Therefore, it simply cannot provide ciphertext stealing.

For now, I will do like the cts crate is doing and manually implement the encrypt/decrypt methods on the Encryptor/Decryptor

zer0x64 commented 1 week ago

Opened up for review, since the InOut refactoring to do can be done in a separate PR.

All IEEE 1619-2018 tests passes, parallel computing is supported, and doc is done.

zer0x64 commented 5 days ago

Made a rookie mistake, the GF operations are not constant time. This should be an easy fix

newpavlov commented 5 days ago

Right now I work on other things, so I will try to take a look at this in a week or two.