Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cipher: rework backend traits (#1636)
This PR splits `BlockBackend` traits into 4 specific traits: `BlockCipherEncBackend`, `BlockCipherDecBackend`, `BlockModeEncBackend`, and `BlockModeDecBackend`. Same for `BlockClosure`. This allows for cipher backends to remove awkard `&mut &backend` juggling (see RustCrypto/block-ciphers#442), makes code a bit easier to read (i.e. `encrypt_blocks` instead of `proc_blocks`), and allows for one backend type to be used for both encryption and decryption. The `impl_simple_block_encdec` macro is removed since we now can implement the backend traits directly on cipher types, which should make implementation crates slightly easier to understand. Additionally, it moves traits to the `block` and `cipher` modules to reduce clutter in the crate root. Later we can add docs to each module to describe the traits in detail.
- Loading branch information