summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'openpgp/src/crypto')
-rw-r--r--openpgp/src/crypto/aead.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/openpgp/src/crypto/aead.rs b/openpgp/src/crypto/aead.rs
index 0f3e5330..93e6ad5d 100644
--- a/openpgp/src/crypto/aead.rs
+++ b/openpgp/src/crypto/aead.rs
@@ -26,6 +26,9 @@ impl AEADAlgorithm {
&EAX =>
// Digest size is independent of the cipher.
Ok(aead::Eax::<cipher::Aes128>::DIGEST_SIZE),
+ &OCB =>
+ // According to RFC4880bis, Section 5.16.2.
+ Ok(16),
_ => Err(Error::UnsupportedAEADAlgorithm(self.clone()).into()),
}
}
@@ -36,6 +39,11 @@ impl AEADAlgorithm {
match self {
&EAX =>
Ok(16), // According to RFC4880bis, Section 5.16.1.
+ &OCB =>
+ // According to RFC4880bis, Section 5.16.2, the IV is "at
+ // least 15 octets long". GnuPG hardcodes 15 in
+ // openpgp_aead_algo_info.
+ Ok(15),
_ => Err(Error::UnsupportedAEADAlgorithm(self.clone()).into()),
}
}