Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New block-modes API design #564

Closed
jethrogb opened this issue Feb 24, 2021 · 1 comment · Fixed by #567
Closed

New block-modes API design #564

jethrogb opened this issue Feb 24, 2021 · 1 comment · Fixed by #567

Comments

@jethrogb
Copy link

(from RustCrypto/block-ciphers#227 (comment))

  • At the type system, support modes requiring only an block encryption function (as opposed to both encryption and decryption)
  • bring back separate types for encryptors and decryptors
  • splitting the trait into two parts: core which works only on blocks (and thus padding-independent) and a buffered wrapper on top of it which would work with slices and will be generic over padding.
@jethrogb
Copy link
Author

jethrogb commented Feb 24, 2021

Additional thoughts:

  • OFB should be a stream cipher abstraction (like CTR)
  • CFB should support a more streaming-like byte-based API (padding is not necessary for decrypting ciphertext of non-block-size-divisible length, and you don't need to encrypt the next block until you have the entire block)

Edit: actually I see these are implemented separately in the stream-ciphers repo 🤦

@newpavlov newpavlov transferred this issue from RustCrypto/block-ciphers Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant