diff --git a/Cargo.toml b/Cargo.toml index dc395f24..b74f462b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,6 @@ byteorder = "^1.4" cast5 = "^0.10.0" cfb-mode = "^0.7.0" chrono = { version = "^0.4", default-features = false, features = ["clock", "std"] } -circular = "^0.3" cipher = "^0.3" clear_on_drop = { version = "0.2.3", features = ["no_cc"] } crc24 = "^0.1" @@ -36,7 +35,6 @@ des = "^0.7" digest = "^0.9" generic-array = "^0.14" hex = "^0.4" -lazy_static = "1.2.0" log = "0.4.6" md-5 = "^0.9" nom = "^4.2" diff --git a/src/crypto/aes_kw.rs b/src/crypto/aes_kw.rs index bbe9b29d..9e894533 100644 --- a/src/crypto/aes_kw.rs +++ b/src/crypto/aes_kw.rs @@ -6,9 +6,7 @@ use generic_array::GenericArray; use crate::errors::Result; -lazy_static! { - static ref IV: GenericArray = arr![u8; 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6]; -} +const IV: [u8; 8] = [0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6]; /// AES Key Wrap /// As defined in RFC 3394. @@ -56,7 +54,7 @@ macro_rules! impl_aes_kw { // 1) Initialize variables // Set A to the IV - let mut a = *IV; + let mut a = GenericArray::from(IV); // for i = 1 to n: R[i] = P[i] let mut r = p.clone(); @@ -147,7 +145,7 @@ macro_rules! impl_aes_kw { // 3) output the results - if a == *IV { + if &a == GenericArray::::from_slice(&IV) { Ok(r.iter().fold(Vec::with_capacity(r.len() * 8), |mut acc, v| { acc.extend(v); acc diff --git a/src/lib.rs b/src/lib.rs index 9792b238..70088f29 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -28,8 +28,6 @@ extern crate num_derive; #[macro_use] extern crate generic_array; #[macro_use] -extern crate lazy_static; -#[macro_use] extern crate log; #[macro_use] extern crate derive_builder;