aboutsummaryrefslogtreecommitdiff
path: root/src/aesround.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/aesround.rs')
-rw-r--r--src/aesround.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/aesround.rs b/src/aesround.rs
index d04ac9b..169c125 100644
--- a/src/aesround.rs
+++ b/src/aesround.rs
@@ -57,6 +57,13 @@ impl AesRound for AesSoft {
}
}
+// It feels silly re-implementing the native AES instruction (especially since aes does use it
+// under the hood), but there is a big benefit here:
+// First, we can save time by only loading the keys once as a __m128i, which makes the whole thing
+// a bit faster.
+// More importantly though, when using target-cpu=native, we get nicely vectorized AES instructions
+// (VAESENC), which we don't get if we go through aes::hazmat::cipher_round. This is a *huge*
+// speedup, which we don't want to miss.
#[cfg(target_arch = "x86_64")]
pub mod x86_64 {
use super::*;