Skip to content

Commit ad15453

Browse files
committed
Fix build with #710
1 parent dea9ae7 commit ad15453

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ members = [
1919
aead-stream = { path = "aead-stream" }
2020
aes-gcm = { path = "aes-gcm" }
2121

22+
# https://github.com/RustCrypto/block-modes/pull/84
23+
belt-ctr = { git = "https://github.com/RustCrypto/block-modes" }
2224
# https://github.com/RustCrypto/utils/pull/1208
2325
block-buffer = { git = "https://github.com/RustCrypto/utils" }
2426
# https://github.com/RustCrypto/stream-ciphers/pull/450
@@ -33,6 +35,8 @@ crypto-common = { git = "https://github.com/RustCrypto/traits" }
3335
ctr = { git = "https://github.com/RustCrypto/block-modes" }
3436
# https://github.com/RustCrypto/utils/pull/1208
3537
dbl = { git = "https://github.com/RustCrypto/utils" }
38+
# https://github.com/RustCrypto/traits/pull/1976
39+
digest = { git = "https://github.com/RustCrypto/traits" }
3640
# https://github.com/RustCrypto/utils/pull/1208
3741
inout = { git = "https://github.com/RustCrypto/utils" }
3842
# https://github.com/RustCrypto/MACs/pull/206

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)