Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ members = [
[patch.crates-io]
aead-stream = { path = "aead-stream" }
aes-gcm = { path = "aes-gcm" }

# https://github.com/RustCrypto/hybrid-array/pull/132
hybrid-array = { git = "https://github.com/kayabaNerve/hybrid-array", branch = "remove-as-ref" }
8 changes: 4 additions & 4 deletions ocb3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ where
let checksum_rhs = &mut [0u8; 16];
checksum_rhs[..remaining_bytes].copy_from_slice(tail.get_in());
checksum_rhs[remaining_bytes] = 0b1000_0000;
inplace_xor(&mut checksum_i, checksum_rhs.as_ref());
inplace_xor(&mut checksum_i, (&*checksum_rhs).into());
// C_* = P_* xor Pad[1..bitlen(P_*)]
let p_star = tail.get_out();
let pad = &mut pad[..p_star.len()];
Expand Down Expand Up @@ -333,7 +333,7 @@ where
let checksum_rhs = &mut [0u8; 16];
checksum_rhs[..remaining_bytes].copy_from_slice(tail.get_out());
checksum_rhs[remaining_bytes] = 0b1000_0000;
inplace_xor(&mut checksum_i, checksum_rhs.as_ref());
inplace_xor(&mut checksum_i, (&*checksum_rhs).into());
}

self.compute_tag(associated_data, &mut checksum_i, &offset_i)
Expand Down Expand Up @@ -609,7 +609,7 @@ mod tests {
let expected_ll0 = Block::from(hex!("1A84ECDE1E3D6E09BD3E058A8723606D"));
let expected_ll1 = Block::from(hex!("3509D9BC3C7ADC137A7C0B150E46C0DA"));

let cipher = aes::Aes128::new(key.as_ref());
let cipher = aes::Aes128::new((&key).into());
let (ll_star, ll_dollar, ll) = key_dependent_variables(&cipher);

assert_eq!(ll_star, expected_ll_star);
Expand All @@ -629,7 +629,7 @@ mod tests {

const TAGLEN: u32 = 16;

let cipher = aes::Aes128::new(key.as_ref());
let cipher = aes::Aes128::new((&key).into());
let (bottom, stretch) =
nonce_dependent_variables::<aes::Aes128, U12>(&cipher, &Nonce::from(nonce), TAGLEN);
let offset_0 = initial_offset::<aes::Aes128, U12>(&cipher, &Nonce::from(nonce), TAGLEN);
Expand Down