diff --git a/src/errors.rs b/src/errors.rs index 8b6ce9b..b5f5a8c 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -8,7 +8,7 @@ use displaydoc::Display; use thiserror::Error; /// Represents an error in the manipulation of internal cryptographic data -#[derive(Debug, Display, Error)] +#[derive(Clone, Debug, Display, Error, Eq, Hash, PartialEq)] pub enum InternalPakeError { /// Deserializing from a byte sequence failed InvalidByteSequence, @@ -56,7 +56,7 @@ pub enum InternalPakeError { } /// Represents an error in password checking -#[derive(Debug, Display, Error)] +#[derive(Clone, Debug, Display, Error, Eq, Hash, PartialEq)] pub enum PakeError { /// This error results from an internal error during PRF construction /// @@ -86,7 +86,7 @@ impl From for PakeError { } /// Represents an error in protocol handling -#[derive(Debug, Display, Error)] +#[derive(Clone, Debug, Display, Error, Eq, Hash, PartialEq)] pub enum ProtocolError { /// This error results from an error during password verification /// diff --git a/src/oprf.rs b/src/oprf.rs index b6b51cf..08f225b 100644 --- a/src/oprf.rs +++ b/src/oprf.rs @@ -12,6 +12,7 @@ use generic_array::GenericArray; use rand::{CryptoRng, RngCore}; /// Used to store the OPRF input and blinding factor +#[cfg_attr(feature = "serialize", derive(serde::Deserialize, serde::Serialize))] pub struct Token { pub(crate) data: Vec, pub(crate) blind: Grp::Scalar,