diff --git a/src/keypair.rs b/src/keypair.rs index 3cad914..e989af8 100644 --- a/src/keypair.rs +++ b/src/keypair.rs @@ -7,7 +7,7 @@ #![allow(unsafe_code)] -use crate::errors::{InternalPakeError, PakeError, ProtocolError}; +use crate::errors::{InternalPakeError, ProtocolError}; use crate::group::Group; #[cfg(test)] use generic_array::typenum::Unsigned; @@ -286,7 +286,7 @@ pub trait SecretKey: Clone + Sized + Zeroize { fn serialize(&self) -> Vec; /// Deserialization from bytes - fn deserialize(input: &[u8]) -> Result; + fn deserialize(input: &[u8]) -> Result; } impl SecretKey for PrivateKey { @@ -308,8 +308,8 @@ impl SecretKey for PrivateKey { self.to_vec() } - fn deserialize(input: &[u8]) -> Result { - PrivateKey::from_bytes(input).map_err(|_| PakeError::SerializationError.into()) + fn deserialize(input: &[u8]) -> Result { + PrivateKey::from_bytes(input).map_err(InternalPakeError::from) } }