block-modes icon indicating copy to clipboard operation
block-modes copied to clipboard

cfb-mode: generic mode block size

Open newpavlov opened this issue 3 years ago • 0 comments

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:

  • [ ] Make BufEncryptor and BufDecryptor generic over method block size
  • [ ] Enforce that mode block size must be smaller or equal to cipher block size

newpavlov avatar Jan 06 '23 20:01 newpavlov