Skip to content

Commit

Permalink
added neon safety comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nstilt1 committed Dec 17, 2023
1 parent b4a408c commit 29d8bc0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chacha20/src/backends/avx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl<R: Rounds> StreamBackend for Backend<R> {

#[inline(always)]
fn gen_par_ks_blocks(&mut self, blocks: &mut ParBlocks<Self>) {
// SAFETY: ParBlocks is a 256-byte 2D array
// SAFETY: `ParBlocks` is a 256-byte 2D array.
unsafe {
self.write_par_ks_blocks(blocks.as_mut_ptr() as *mut u8);
}
Expand Down
5 changes: 4 additions & 1 deletion chacha20/src/backends/neon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ impl<R: Rounds> StreamBackend for Backend<R> {

#[inline(always)]
fn gen_par_ks_blocks(&mut self, blocks: &mut ParBlocks<Self>) {
self.write_par_ks_blocks(blocks.as_mut_ptr() as *mut u8);
// SAFETY: `ParBlocks` is a 256-byte 2D array.
unsafe {
self.write_par_ks_blocks(blocks.as_mut_ptr() as *mut u8);
}
}
}

Expand Down

0 comments on commit 29d8bc0

Please sign in to comment.