Skip to content

openpgp: Make crypto backends responsible for IV

Nikhil Benesch requested to merge nbenesch/sequoia:iv-responsibility into master

Adjust the interface of crypto::symmetric::Mode so that the crypto backend is responsible for managing the IV rather than the caller.

The new API is one step towards facilitating a RustCrypto backend for Sequoia (see #333 (closed)), as RustCrypto does not expose the IV modifications to the caller.

As a bonus, this commit introduces proper support for ECB mode. Previously callers that wanted ECB mode would request CBC mode, then hackily zero out the IV on each call. Nettle actually has proper support for ECB mode, just via a slightly different API.

Merge request reports