Skip to content

Commit 4e4da69

Browse files
authored
Bump hybrid-array to v0.4 (#710)
1 parent ddbe4dc commit 4e4da69

File tree

5 files changed

+47
-32
lines changed

5 files changed

+47
-32
lines changed

Cargo.lock

Lines changed: 16 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,26 @@ members = [
1818
[patch.crates-io]
1919
aead-stream = { path = "aead-stream" }
2020
aes-gcm = { path = "aes-gcm" }
21+
22+
# https://github.com/RustCrypto/block-modes/pull/84
23+
belt-ctr = { git = "https://github.com/RustCrypto/block-modes" }
24+
# https://github.com/RustCrypto/utils/pull/1208
25+
block-buffer = { git = "https://github.com/RustCrypto/utils" }
26+
# https://github.com/RustCrypto/stream-ciphers/pull/450
27+
chacha20 = { git = "https://github.com/RustCrypto/stream-ciphers" }
28+
# https://github.com/RustCrypto/traits/pull/1976
29+
cipher = { git = "https://github.com/RustCrypto/traits" }
30+
# https://github.com/RustCrypto/MACs/pull/206
31+
cmac = { git = "https://github.com/RustCrypto/MACs" }
32+
# https://github.com/RustCrypto/traits/pull/1976
33+
crypto-common = { git = "https://github.com/RustCrypto/traits" }
34+
# https://github.com/RustCrypto/block-modes/pull/84
35+
ctr = { git = "https://github.com/RustCrypto/block-modes" }
36+
# https://github.com/RustCrypto/utils/pull/1208
37+
dbl = { git = "https://github.com/RustCrypto/utils" }
38+
# https://github.com/RustCrypto/traits/pull/1976
39+
digest = { git = "https://github.com/RustCrypto/traits" }
40+
# https://github.com/RustCrypto/utils/pull/1208
41+
inout = { git = "https://github.com/RustCrypto/utils" }
42+
# https://github.com/RustCrypto/MACs/pull/206
43+
pmac = { git = "https://github.com/RustCrypto/MACs" }

aes-siv/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ aes = "0.9.0-rc.0"
2222
cipher = "0.5.0-rc.0"
2323
cmac = "0.8.0-rc.0"
2424
ctr = "0.10.0-rc.0"
25-
dbl = "0.4.0-rc.1"
25+
dbl = "0.5.0-pre"
2626
digest = { version = "0.11.0-rc.0", features = ["mac"] }
2727
zeroize = { version = "1", optional = true, default-features = false }
2828

ocb3/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ rust-version = "1.85"
1919
aead = { version = "0.6.0-rc.1", default-features = false }
2020
cipher = "0.5.0-rc.0"
2121
ctr = "0.10.0-rc.0"
22-
dbl = "0.4.0-rc.2"
22+
dbl = "0.5.0-pre"
2323
subtle = { version = "2", default-features = false }
2424
aead-stream = { version = "0.6.0-rc.0", optional = true, default-features = false }
2525
zeroize = { version = "1", optional = true, default-features = false }

ocb3/src/lib.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub mod consts {
1515

1616
pub use aead::{
1717
self, AeadCore, AeadInOut, Error, KeyInit, KeySizeUser,
18-
array::{Array, AssocArraySize},
18+
array::{Array, AsArrayRef, AssocArraySize},
1919
};
2020

2121
use aead::{
@@ -249,7 +249,7 @@ where
249249
let checksum_rhs = &mut [0u8; 16];
250250
checksum_rhs[..remaining_bytes].copy_from_slice(tail.get_in());
251251
checksum_rhs[remaining_bytes] = 0b1000_0000;
252-
inplace_xor(&mut checksum_i, checksum_rhs.as_ref());
252+
inplace_xor(&mut checksum_i, checksum_rhs.as_array_ref());
253253
// C_* = P_* xor Pad[1..bitlen(P_*)]
254254
let p_star = tail.get_out();
255255
let pad = &mut pad[..p_star.len()];
@@ -333,7 +333,7 @@ where
333333
let checksum_rhs = &mut [0u8; 16];
334334
checksum_rhs[..remaining_bytes].copy_from_slice(tail.get_out());
335335
checksum_rhs[remaining_bytes] = 0b1000_0000;
336-
inplace_xor(&mut checksum_i, checksum_rhs.as_ref());
336+
inplace_xor(&mut checksum_i, checksum_rhs.as_array_ref());
337337
}
338338

339339
self.compute_tag(associated_data, &mut checksum_i, &offset_i)
@@ -588,6 +588,7 @@ pub(crate) fn split_into_two_blocks<'i, 'o>(
588588
#[cfg(test)]
589589
mod tests {
590590
use super::*;
591+
use aead::array::Array;
591592
use dbl::Dbl;
592593
use hex_literal::hex;
593594

@@ -609,7 +610,7 @@ mod tests {
609610
let expected_ll0 = Block::from(hex!("1A84ECDE1E3D6E09BD3E058A8723606D"));
610611
let expected_ll1 = Block::from(hex!("3509D9BC3C7ADC137A7C0B150E46C0DA"));
611612

612-
let cipher = aes::Aes128::new(key.as_ref());
613+
let cipher = aes::Aes128::new(&Array(key));
613614
let (ll_star, ll_dollar, ll) = key_dependent_variables(&cipher);
614615

615616
assert_eq!(ll_star, expected_ll_star);
@@ -629,7 +630,7 @@ mod tests {
629630

630631
const TAGLEN: u32 = 16;
631632

632-
let cipher = aes::Aes128::new(key.as_ref());
633+
let cipher = aes::Aes128::new(&Array(key));
633634
let (bottom, stretch) =
634635
nonce_dependent_variables::<aes::Aes128, U12>(&cipher, &Nonce::from(nonce), TAGLEN);
635636
let offset_0 = initial_offset::<aes::Aes128, U12>(&cipher, &Nonce::from(nonce), TAGLEN);

0 commit comments

Comments
 (0)