From 278350598251d27b8cc1f04af4395061b1749a20 Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Tue, 26 Sep 2023 01:45:05 +0300 Subject: [PATCH] aes: add #[inline] attributes for KeyInit::new impls (#386) --- aes/src/armv8.rs | 2 ++ aes/src/ni.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/aes/src/armv8.rs b/aes/src/armv8.rs index 3ece1b44..20307bb9 100644 --- a/aes/src/armv8.rs +++ b/aes/src/armv8.rs @@ -147,6 +147,7 @@ macro_rules! define_aes_impl { } impl KeyInit for $name_enc { + #[inline] fn new(key: &Key) -> Self { Self { round_keys: unsafe { expand_key(key.as_ref()) }, @@ -208,6 +209,7 @@ macro_rules! define_aes_impl { } impl KeyInit for $name_dec { + #[inline] fn new(key: &Key) -> Self { $name_enc::new(key).into() } diff --git a/aes/src/ni.rs b/aes/src/ni.rs index 15b49ef5..a905bda9 100644 --- a/aes/src/ni.rs +++ b/aes/src/ni.rs @@ -157,6 +157,7 @@ macro_rules! define_aes_impl { } impl KeyInit for $name_enc { + #[inline] fn new(key: &Key) -> Self { // SAFETY: we enforce that this code is called only when // target features required by `expand` were properly checked. @@ -220,6 +221,7 @@ macro_rules! define_aes_impl { } impl KeyInit for $name_dec { + #[inline] fn new(key: &Key) -> Self { $name_enc::new(key).into() }