diff --git a/Cargo.toml b/Cargo.toml index 693d821..c1feb57 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,6 @@ default = [ "v4_local", "v4_public", ] -aes = ["dep:aes", "dep:ctr"] [lib] doctest = true @@ -60,8 +59,7 @@ serde_json = { version = "^1.0.68", optional = true } thiserror = "1.0.29" iso8601 = "0.6.1" erased-serde = { version = "0.4.5", optional = true } -aes = { version = "0.8.4", optional = true } -ctr = { version = "0.9.2", optional = true } +aes = { version = "0.7.5", features = ["ctr"], optional = true } hmac = { version = "0.12.1", optional = true } sha2 = { version = "0.10.2", optional = true } zeroize = { version = "1.4.3", features = ["zeroize_derive"] } diff --git a/src/core/common/cipher_text_impl/v1_local.rs b/src/core/common/cipher_text_impl/v1_local.rs index 9024c0f..2f3b2cb 100644 --- a/src/core/common/cipher_text_impl/v1_local.rs +++ b/src/core/common/cipher_text_impl/v1_local.rs @@ -1,13 +1,12 @@ #![cfg(feature = "v1_local")] use std::marker::PhantomData; +use aes::Aes256Ctr; use aes::cipher::generic_array::GenericArray; -use aes::cipher::{KeyIvInit, StreamCipher}; +use aes::cipher::{NewCipher, StreamCipher}; use crate::core::common::cipher_text::CipherText; use crate::core::{Local, V1}; use crate::core::common::EncryptionKey; -type Aes256Ctr = ctr::Ctr64BE; - impl CipherText { pub(crate) fn from(payload: &[u8], encryption_key: &EncryptionKey) -> Self { let key = GenericArray::from_slice(encryption_key.as_ref()); @@ -25,4 +24,4 @@ impl CipherText { purpose: PhantomData, } } -} +} \ No newline at end of file diff --git a/src/core/common/cipher_text_impl/v3_local.rs b/src/core/common/cipher_text_impl/v3_local.rs index 5963f4d..fce2cde 100644 --- a/src/core/common/cipher_text_impl/v3_local.rs +++ b/src/core/common/cipher_text_impl/v3_local.rs @@ -2,12 +2,10 @@ use std::marker::PhantomData; use aes::Aes256Ctr; use aes::cipher::generic_array::GenericArray; -use aes::cipher::{KeyIvInit, StreamCipher}; +use aes::cipher::{NewCipher, StreamCipher}; use crate::core::common::{CipherText, EncryptionKey}; use crate::core::{Local, V3}; -type Aes256Ctr = ctr::Ctr64BE; - impl CipherText { pub(crate) fn from(payload: &[u8], encryption_key: &EncryptionKey) -> Self { let key = GenericArray::from_slice(encryption_key.as_ref()); @@ -25,4 +23,4 @@ impl CipherText { purpose: PhantomData, } } -} +} \ No newline at end of file