Skip to content

Commit

Permalink
update safety comments
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgazelka committed Oct 22, 2023
1 parent beaf72f commit dfd13ca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/protocol/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl Aes {
}

pub fn encrypt(&mut self, elem: &mut [u8]) {
// SAFETY: Cfb8Block is POD (plain old data)
let (prefix, blocks, suffix) = unsafe { elem.align_to_mut::<Cfb8Block>() };

debug_assert!(prefix.is_empty());
Expand All @@ -47,6 +48,7 @@ impl Aes {
}

pub fn decrypt(&mut self, elem: &mut [u8]) {
// SAFETY: Cfb8Block is POD (plain old data)
let (prefix, blocks, suffix) = unsafe { elem.align_to_mut::<Cfb8Block>() };

debug_assert!(prefix.is_empty());
Expand Down

0 comments on commit dfd13ca

Please sign in to comment.