From df5536819bbac61ae5642d74c9e18993f5259486 Mon Sep 17 00:00:00 2001 From: Avril Date: Wed, 30 Sep 2020 14:26:02 +0100 Subject: [PATCH] more ser --- Cargo.toml | 2 +- src/aes.rs | 1 + src/password.rs | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 8b231c7..71fc82e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cryptohelpers" -version = "1.3.0" +version = "1.3.1" license= "MIT" description = "Collection of helpers and simplifying functions for cryptography things" authors = ["Avril "] diff --git a/src/aes.rs b/src/aes.rs index 48cd68a..86ee078 100644 --- a/src/aes.rs +++ b/src/aes.rs @@ -30,6 +30,7 @@ const BLOCKSIZE: usize = 16; /// A key and IV for the AES algorithm #[derive(Debug, PartialEq, Eq, Clone, Hash, Default)] +#[cfg_attr(feature="serialise", derive(Serialize,Deserialize))] pub struct AesKey { key: [u8; KEYSIZE], iv: [u8; IVSIZE], diff --git a/src/password.rs b/src/password.rs index 7222805..89c8bf9 100644 --- a/src/password.rs +++ b/src/password.rs @@ -20,6 +20,7 @@ pub const ROUNDS: u32 = consts::PASSWORD_ROUNDS; /// Represents a password hash #[derive(Clone, Debug, PartialEq, Eq, Hash, Default)] #[repr(transparent)] +#[cfg_attr(feature="serialise", derive(Serialize,Deserialize))] pub struct Password { derived: [u8; KEYSIZE], } @@ -27,6 +28,7 @@ pub struct Password { /// Represents a salt to be used for password operations #[derive(Clone, PartialEq, Eq, Hash, Debug)] #[repr(transparent)] +#[cfg_attr(feature="serialise", derive(Serialize,Deserialize))] pub struct Salt([u8; SALTSIZE]); impl Default for Salt