From 00357d7894639313efb919147c88d0f9d2580400 Mon Sep 17 00:00:00 2001 From: M <149858635+mm9942@users.noreply.github.com> Date: Wed, 22 Jan 2025 01:54:31 +0100 Subject: [PATCH] Fix: V1.3.10 --- src/Core/cipher_xchacha_poly.rs | 2 +- src/Core/kyber/kyber_crypto_xchacha_poly.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Core/cipher_xchacha_poly.rs b/src/Core/cipher_xchacha_poly.rs index bc50a31..a8104df 100644 --- a/src/Core/cipher_xchacha_poly.rs +++ b/src/Core/cipher_xchacha_poly.rs @@ -42,7 +42,7 @@ impl CipherChaCha_Poly { /// /// # Returns /// A new CipherChaCha instance. - pub fn create(infos: CryptographicInformation, nonce: Option) -> Self { + pub fn new(infos: CryptographicInformation, nonce: Option) -> Self { let nonce: [u8; 24] = match nonce { Some(nonce) => { let mut array = [0u8; 24]; diff --git a/src/Core/kyber/kyber_crypto_xchacha_poly.rs b/src/Core/kyber/kyber_crypto_xchacha_poly.rs index 90699f3..47418c7 100644 --- a/src/Core/kyber/kyber_crypto_xchacha_poly.rs +++ b/src/Core/kyber/kyber_crypto_xchacha_poly.rs @@ -51,7 +51,7 @@ where ); let file = FileMetadata::from(path, FileTypes::other(), FileState::not_encrypted()); let infos = CryptographicInformation::from(Vec::new(), passphrase.as_bytes().to_vec(), crypt_metadata, true, Some(file)); - let mut xchacha = CipherChaCha_Poly::create(infos, None); + let mut xchacha = CipherChaCha_Poly::new(infos, None); log_activity!("Creating a new cipher instance of XChaCha20Poly1305.", ""); let _ = self.kyber_data.set_nonce(hex::encode(xchacha.nonce())); @@ -83,7 +83,7 @@ where ContentType::message(), ); let infos = CryptographicInformation::from(message.as_bytes().to_owned(), passphrase.as_bytes().to_vec(), crypt_metadata, false, None); - let mut xchacha = CipherChaCha_Poly::create(infos, None); + let mut xchacha = CipherChaCha_Poly::new(infos, None); log_activity!("Creating a new cipher instance of XChaCha20Poly1305.", ""); let _ = self.kyber_data.set_nonce(hex::encode(xchacha.nonce())); @@ -115,7 +115,7 @@ where ContentType::message(), ); let infos = CryptographicInformation::from(data, passphrase.as_bytes().to_vec(), crypt_metadata, false, None); - let mut xchacha = CipherChaCha_Poly::create(infos, None); + let mut xchacha = CipherChaCha_Poly::new(infos, None); log_activity!("Creating a new cipher instance of XChaCha20Poly1305.", ""); let _ = self.kyber_data.set_nonce(hex::encode(xchacha.nonce())); @@ -185,7 +185,7 @@ where ); let file = FileMetadata::from(path, FileTypes::other(), FileState::encrypted()); let infos = CryptographicInformation::from(Vec::new(), passphrase.as_bytes().to_vec(), crypt_metadata, true, Some(file)); - let mut xchacha = CipherChaCha_Poly::create(infos, Some(self.kyber_data.nonce()?.to_string())); + let mut xchacha = CipherChaCha_Poly::new(infos, Some(self.kyber_data.nonce()?.to_string())); log_activity!("Creating a new cipher instance of XChaCha20Poly1305.", ""); let data = xchacha.decrypt(self.kyber_data.key()?, ciphertext).unwrap(); @@ -215,7 +215,7 @@ where ContentType::message(), ); let infos = CryptographicInformation::from(message, passphrase.as_bytes().to_vec(), crypt_metadata, false, None); - let mut xchacha = CipherChaCha_Poly::create(infos, Some(self.kyber_data.nonce()?.to_string())); + let mut xchacha = CipherChaCha_Poly::new(infos, Some(self.kyber_data.nonce()?.to_string())); log_activity!("Creating a new cipher instance of XChaCha20Poly1305.", ""); let data = xchacha.decrypt(self.kyber_data.key()?, ciphertext).unwrap(); @@ -246,7 +246,7 @@ where ContentType::message(), ); let infos = CryptographicInformation::from(data, passphrase.as_bytes().to_vec(), crypt_metadata, false, None); - let mut xchacha = CipherChaCha_Poly::create(infos, Some(self.kyber_data.nonce()?.to_string())); + let mut xchacha = CipherChaCha_Poly::new(infos, Some(self.kyber_data.nonce()?.to_string())); log_activity!("Creating a new cipher instance of XChaCha20Poly1305.", ""); let data = xchacha.decrypt(self.kyber_data.key()?, ciphertext).unwrap();