From 4a0c4830af9d015d87cfa5575a510a23edcd9e66 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Fri, 5 Mar 2021 12:13:27 -0800 Subject: [PATCH] AEAD internals: Remove redundant `cpu_features` parameter from `gcm::Context::is_avx2()`. --- src/aead/aes_gcm.rs | 4 ++-- src/aead/gcm.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/aead/aes_gcm.rs b/src/aead/aes_gcm.rs index d67e38872..25a5bfbfb 100644 --- a/src/aead/aes_gcm.rs +++ b/src/aead/aes_gcm.rs @@ -86,7 +86,7 @@ fn aes_gcm_seal( #[cfg(target_arch = "x86_64")] let in_out = { - if !aes_key.is_aes_hw() || !auth.is_avx2(cpu_features) { + if !aes_key.is_aes_hw() || !auth.is_avx2() { in_out } else { use crate::c; @@ -163,7 +163,7 @@ fn aes_gcm_open( #[cfg(target_arch = "x86_64")] let in_out = { - if !aes_key.is_aes_hw() || !auth.is_avx2(cpu_features) { + if !aes_key.is_aes_hw() || !auth.is_avx2() { in_out } else { use crate::c; diff --git a/src/aead/gcm.rs b/src/aead/gcm.rs index a22dbd91f..63356b254 100644 --- a/src/aead/gcm.rs +++ b/src/aead/gcm.rs @@ -235,8 +235,8 @@ impl Context { } #[cfg(target_arch = "x86_64")] - pub(super) fn is_avx2(&self, cpu_features: cpu::Features) -> bool { - match detect_implementation(cpu_features) { + pub(super) fn is_avx2(&self) -> bool { + match detect_implementation(self.cpu_features) { Implementation::CLMUL => has_avx_movbe(self.cpu_features), _ => false, }