Remove breaking change

This commit is contained in:
daxpedda
2021-07-23 15:23:10 -07:00
committed by Kevin Lewi
parent 3d01a605df
commit 17b9c49473
+4 -4
View File
@@ -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<G: Group>: Clone + Sized + Zeroize {
fn serialize(&self) -> Vec<u8>;
/// Deserialization from bytes
fn deserialize(input: &[u8]) -> Result<Self, ProtocolError>;
fn deserialize(input: &[u8]) -> Result<Self, InternalPakeError>;
}
impl<G: Group> SecretKey<G> for PrivateKey<G> {
@@ -308,8 +308,8 @@ impl<G: Group> SecretKey<G> for PrivateKey<G> {
self.to_vec()
}
fn deserialize(input: &[u8]) -> Result<Self, ProtocolError> {
PrivateKey::from_bytes(input).map_err(|_| PakeError::SerializationError.into())
fn deserialize(input: &[u8]) -> Result<Self, InternalPakeError> {
PrivateKey::from_bytes(input).map_err(InternalPakeError::from)
}
}