summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto/backend/rust/aead.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2022-01-10 16:35:54 +0100
committerJustus Winter <justus@sequoia-pgp.org>2022-02-17 16:11:38 +0100
commit984f4c6b8040fc969f54ddf1f8b726f94ffd2383 (patch)
tree020a0333d46625cbfccb4b9576b279d44a95c332 /openpgp/src/crypto/backend/rust/aead.rs
parent442f766d6f294399b8986656e942fa1740e22438 (diff)
openpgp: Implement GCM mode.justus/openpgp-next-gcm
- The Galois/Counter mode for block ciphers is a FIPS-approved AEAD mode. It will be added to the upcoming OpenPGP standard so that we have a FIPS-compliant subset of OpenPGP. - Currently, this is only implemented by the Nettle backend.
Diffstat (limited to 'openpgp/src/crypto/backend/rust/aead.rs')
-rw-r--r--openpgp/src/crypto/backend/rust/aead.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/openpgp/src/crypto/backend/rust/aead.rs b/openpgp/src/crypto/backend/rust/aead.rs
index e5fcdb0b..4a51b427 100644
--- a/openpgp/src/crypto/backend/rust/aead.rs
+++ b/openpgp/src/crypto/backend/rust/aead.rs
@@ -150,7 +150,11 @@ impl AEADAlgorithm {
| SymmetricAlgorithm::Unencrypted =>
Err(Error::UnsupportedSymmetricAlgorithm(sym_algo).into()),
},
- AEADAlgorithm::OCB | AEADAlgorithm::Private(_) | AEADAlgorithm::Unknown(_) =>
+ AEADAlgorithm::OCB =>
+ Err(Error::UnsupportedAEADAlgorithm(*self).into()),
+ AEADAlgorithm::GCM =>
+ Err(Error::UnsupportedAEADAlgorithm(*self).into()),
+ AEADAlgorithm::Private(_) | AEADAlgorithm::Unknown(_) =>
Err(Error::UnsupportedAEADAlgorithm(*self).into()),
}
}