diff --git a/Cargo.lock b/Cargo.lock index 19877f68..1eaa3072 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,7 +82,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cipher" version = "0.5.0-pre" -source = "git+https://github.com/RustCrypto/traits.git#ea9f8a3ded8137ce3d8729b165bc4d413cc52486" +source = "git+https://github.com/RustCrypto/traits.git#6810dc1dcfe9949f2f2e8e6f3e077737b97c06f1" dependencies = [ "blobby", "crypto-common", @@ -101,9 +101,9 @@ dependencies = [ [[package]] name = "crypto-common" -version = "0.2.0-pre.1" +version = "0.2.0-pre.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47bf010313404f942f7da6931d00bd455bb4c36c36c9d4dd9497b5ac316f6fe1" +checksum = "102f7900795d54e3b8566857762a2977c267ab5952e4117283017ee1d5c9ae88" dependencies = [ "hybrid-array", ] @@ -129,9 +129,7 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hybrid-array" -version = "0.2.0-pre.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f148d5add3c53ebf18452f556b0437d3d5c4540f34eb7b80c5ad4b54632c4e2" +version = "0.2.0-pre.7" dependencies = [ "typenum", ] @@ -145,9 +143,9 @@ dependencies = [ [[package]] name = "inout" -version = "0.2.0-pre.1" +version = "0.2.0-pre.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed415a0622334b6e89f6361616b133f5ca2a8a31c5007ca594d9180e5930ec8" +checksum = "25049cbfd794227f26a7d3c7f2cfc2a9737a229993799bfca1138242964886ee" dependencies = [ "hybrid-array", ] diff --git a/Cargo.toml b/Cargo.toml index 704d81a5..4597ca43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,4 +25,5 @@ members = [ opt-level = 2 [patch.crates-io] +hybrid-array = { path = "../utils/hybrid-array" } cipher = { git = "https://github.com/RustCrypto/traits.git" } diff --git a/aes/src/soft.rs b/aes/src/soft.rs index 5f90b1e2..dab9a154 100644 --- a/aes/src/soft.rs +++ b/aes/src/soft.rs @@ -63,7 +63,7 @@ macro_rules! define_aes_impl { #[inline] fn new(key: &Key) -> Self { Self { - keys: $fixslice_key_schedule(key.as_ref()), + keys: $fixslice_key_schedule(key.into()), } } } diff --git a/aria/tests/mod.rs b/aria/tests/mod.rs index e92f0a5d..42e00d57 100644 --- a/aria/tests/mod.rs +++ b/aria/tests/mod.rs @@ -13,9 +13,9 @@ fn test_rfc5794_a1() { let mut buf = Array::from(pt); c.encrypt_block(&mut buf); - assert_eq!(buf.as_ref(), &ct); + assert_eq!(&buf, &ct); c.decrypt_block(&mut buf); - assert_eq!(buf.as_ref(), &pt); + assert_eq!(&buf, &pt); } /// Test vector from RFC 5794, Appendix A.2 @@ -29,9 +29,9 @@ fn test_rfc5794_a2() { let mut buf = Array::from(pt); c.encrypt_block(&mut buf); - assert_eq!(buf.as_ref(), &ct); + assert_eq!(&buf, &ct); c.decrypt_block(&mut buf); - assert_eq!(buf.as_ref(), &pt); + assert_eq!(&buf, &pt); } /// Test vector from RFC 5794, Appendix A.3 @@ -45,7 +45,7 @@ fn test_rfc5794_a3() { let mut buf = Array::from(pt); c.encrypt_block(&mut buf); - assert_eq!(buf.as_ref(), &ct); + assert_eq!(&buf, &ct); c.decrypt_block(&mut buf); - assert_eq!(buf.as_ref(), &pt); + assert_eq!(&buf, &pt); } diff --git a/belt-block/tests/mod.rs b/belt-block/tests/mod.rs index d0135e05..dab12ac0 100644 --- a/belt-block/tests/mod.rs +++ b/belt-block/tests/mod.rs @@ -34,9 +34,9 @@ fn belt_block() { let cipher = BeltBlock::new(&key.into()); let mut block = pt.into(); cipher.encrypt_block(&mut block); - assert_eq!(block, ct.into()); + assert_eq!(block, ct); cipher.decrypt_block(&mut block); - assert_eq!(block, pt.into()); + assert_eq!(block, pt); } } } diff --git a/cast6/tests/mod.rs b/cast6/tests/mod.rs index 3ee8358a..b6518793 100644 --- a/cast6/tests/mod.rs +++ b/cast6/tests/mod.rs @@ -9,9 +9,9 @@ fn rfc2144_a() { let key128 = hex!("2342bb9efa38542c0af75647f29f615d"); let key192 = hex!("2342bb9efa38542cbed0ac83940ac298bac77a7717942863"); let key256 = hex!("2342bb9efa38542cbed0ac83940ac2988d7c47ce264908461cc1b5137ae6b604"); - let ct128 = hex!("c842a08972b43d20836c91d1b7530f6b").into(); - let ct192 = hex!("1b386c0210dcadcbdd0e41aa08a7a7e8").into(); - let ct256 = hex!("4f6a2038286897b9c9870136553317fa").into(); + let ct128 = hex!("c842a08972b43d20836c91d1b7530f6b"); + let ct192 = hex!("1b386c0210dcadcbdd0e41aa08a7a7e8"); + let ct256 = hex!("4f6a2038286897b9c9870136553317fa"); let pt = Block::::default(); let mut buf = pt;