diff options
Diffstat (limited to 'openpgp/src/crypto')
-rw-r--r-- | openpgp/src/crypto/backend/rust/symmetric.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/openpgp/src/crypto/backend/rust/symmetric.rs b/openpgp/src/crypto/backend/rust/symmetric.rs index f96def91..fd010824 100644 --- a/openpgp/src/crypto/backend/rust/symmetric.rs +++ b/openpgp/src/crypto/backend/rust/symmetric.rs @@ -222,8 +222,9 @@ macro_rules! impl_enc_mode { _dst: &mut [u8], _src: &[u8], ) -> Result<()> { - Err(anyhow::anyhow!( - "decryption not supported in encryption mode")) + Err(Error::InvalidOperation( + "decryption not supported in encryption mode".into()) + .into()) } } } @@ -240,8 +241,9 @@ macro_rules! impl_dec_mode { _dst: &mut [u8], _src: &[u8], ) -> Result<()> { - Err(anyhow::anyhow!( - "encryption not supported in decryption mode")) + Err(Error::InvalidOperation( + "encryption not supported in decryption mode".into()) + .into()) } fn decrypt( |