Skip to content

Commit

Permalink
Revert "chore: update aes to 0.8 (#44)" (#45)
Browse files Browse the repository at this point in the history
This reverts commit 7ba2ae8.
  • Loading branch information
rrrodzilla authored Jul 22, 2024
1 parent 7ba2ae8 commit b464925
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ default = [
"v4_local",
"v4_public",
]
aes = ["dep:aes", "dep:ctr"]

[lib]
doctest = true
Expand All @@ -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"] }
Expand Down
7 changes: 3 additions & 4 deletions src/core/common/cipher_text_impl/v1_local.rs
Original file line number Diff line number Diff line change
@@ -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<aes::Aes256>;

impl CipherText<V1, Local> {
pub(crate) fn from(payload: &[u8], encryption_key: &EncryptionKey<V1, Local>) -> Self {
let key = GenericArray::from_slice(encryption_key.as_ref());
Expand All @@ -25,4 +24,4 @@ impl CipherText<V1, Local> {
purpose: PhantomData,
}
}
}
}
6 changes: 2 additions & 4 deletions src/core/common/cipher_text_impl/v3_local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<aes::Aes256>;

impl CipherText<V3, Local> {
pub(crate) fn from(payload: &[u8], encryption_key: &EncryptionKey<V3, Local>) -> Self {
let key = GenericArray::from_slice(encryption_key.as_ref());
Expand All @@ -25,4 +23,4 @@ impl CipherText<V3, Local> {
purpose: PhantomData,
}
}
}
}

0 comments on commit b464925

Please sign in to comment.