Skip to content

Commit

Permalink
Fix AES intrinsics on ARM (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
orlp authored Oct 20, 2023
1 parent f9acd50 commit 8332f50
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub(crate) fn aesenc(value: u128, xor: u128) -> u128 {
use core::mem::transmute;
unsafe {
let value = transmute(value);
transmute(vaesmcq_u8(vaeseq_u8(value, transmute(xor))))
xor ^ transmute::<_, u128>(vaesmcq_u8(vaeseq_u8(value, transmute(0u128))))
}
}

Expand Down Expand Up @@ -163,7 +163,7 @@ pub(crate) fn aesdec(value: u128, xor: u128) -> u128 {
use core::mem::transmute;
unsafe {
let value = transmute(value);
transmute(vaesimcq_u8(vaesdq_u8(value, transmute(xor))))
xor ^ transmute::<_, u128>(vaesimcq_u8(vaesdq_u8(value, transmute(0u128))))
}
}

Expand Down

0 comments on commit 8332f50

Please sign in to comment.