Separate Nettle-specific implementation details
Another attempt at !627 (closed) and #333 (closed).
With this applied, the only places that use nettle unconditionally are two tests using {ed,x25519} key pairs, which still needs to be addressed:
- https://gitlab.com/sequoia-pgp/sequoia/blob/e9f1216d8d5c4de851bfe9f98d65bce473320e9f/openpgp/src/packet/pkesk.rs#L356
- https://gitlab.com/sequoia-pgp/sequoia/blob/2e1eec5fe4157a391a13554ff7df3075cfe043cc/openpgp/src/packet/signature/mod.rs#L1505
I tried to only split the parts from the implementation that touched the Nettle implementation directly.
For instance, in AEAD we only concern ourselves with the Aead
trait from Nettle, so I duplicated it in crypto/aead.rs and reimplemented it in terms of nettle::aead::Aead
and only construct and return the high-level Box<dyn Aead>
instead (this is what I originally had in mind when coming up with traits for the common low-level crypto operations).
@teythoon I hope this is more what you had in mind. Are you satisfied with the direction of this MR?