summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto/backend/nettle
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2020-11-17 07:04:01 +0100
committerAzul <azul@riseup.net>2020-11-24 12:24:36 +0100
commit43ad20c16ccee274cc4ecdb327e70e2349fa12ad (patch)
tree8f5a4ee4c08643a914fb519e609c987d57617a40 /openpgp/src/crypto/backend/nettle
parent7fb0e9302b1145d959bdb81b064b453d21f49b3a (diff)
openpgp: seal Aead trait.
- Seal the Aead trait so it cannot be implemented outside the openpgp crate. - This way we can extend the trait without breaking the API compatibility. - See #538.
Diffstat (limited to 'openpgp/src/crypto/backend/nettle')
-rw-r--r--openpgp/src/crypto/backend/nettle/aead.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/openpgp/src/crypto/backend/nettle/aead.rs b/openpgp/src/crypto/backend/nettle/aead.rs
index 1614a20a..797dd040 100644
--- a/openpgp/src/crypto/backend/nettle/aead.rs
+++ b/openpgp/src/crypto/backend/nettle/aead.rs
@@ -4,8 +4,10 @@ use nettle::{aead, cipher};
use crate::{Error, Result};
use crate::crypto::aead::Aead;
+use crate::seal;
use crate::types::{AEADAlgorithm, SymmetricAlgorithm};
+impl<T: nettle::aead::Aead> seal::Sealed for T {}
impl<T: nettle::aead::Aead> Aead for T {
fn update(&mut self, ad: &[u8]) {
self.update(ad)