RustCrypto / block-modes

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

cfb-mode: generic mode block size #32

Open newpavlov opened 1 year ago

newpavlov commented 1 year ago

It makes the cfb8 crate redundant and enables support of other CFB variants.

Unfortunately, it's currently impossible to preserve parallel decryption since ParBlocksSize gets tied to block size, which could be different for an underlying cipher and used mode, i.e. AES-CFB8 has cipher and mode block sizes equal to 16 and 1 respectively. In other words, with the current trait design we can not write type ParBlocksSize = C::ParBlocksSize, because ParBlocksSize is bounded by ArrayLength<Block<Self>>.

TODO: