From a992a4e831759f248bbb8198e6d6bdad1e643a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Mon, 23 May 2022 11:07:12 +0200 Subject: [PATCH] feat(store-encryption): Derive Eq for some structs --- crates/matrix-sdk-store-encryption/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/matrix-sdk-store-encryption/src/lib.rs b/crates/matrix-sdk-store-encryption/src/lib.rs index 2b2735647..f582a9470 100644 --- a/crates/matrix-sdk-store-encryption/src/lib.rs +++ b/crates/matrix-sdk-store-encryption/src/lib.rs @@ -500,7 +500,7 @@ impl MacKey { /// Encrypted value, ready for storage, as created by the /// [`StoreCipher::encrypt_value_data()`] -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct EncryptedValue { version: u8, ciphertext: Vec, @@ -557,7 +557,7 @@ impl Keys { } /// Version specific info for the key derivation method that is used. -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] enum KdfInfo { /// The PBKDF2 to Chacha key derivation variant. Pbkdf2ToChaCha20Poly1305 { @@ -572,7 +572,7 @@ enum KdfInfo { /// Version specific info for encryption method that is used to encrypt our /// store cipher. -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] enum CipherTextInfo { /// A store cipher encrypted using the ChaCha20Poly1305 AEAD. ChaCha20Poly1305 { @@ -585,7 +585,7 @@ enum CipherTextInfo { /// An encrypted version of our store cipher, this can be safely stored in a /// database. -#[derive(Debug, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] struct EncryptedStoreCipher { /// Info about the key derivation method that was used to expand the /// passphrase into an encryption key.