Skip to content

Commit

Permalink
aes: add #[inline] attributes for KeyInit::new impls (#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Sep 25, 2023
1 parent 9413fca commit 2783505
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aes/src/armv8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ macro_rules! define_aes_impl {
}

impl KeyInit for $name_enc {
#[inline]
fn new(key: &Key<Self>) -> Self {
Self {
round_keys: unsafe { expand_key(key.as_ref()) },
Expand Down Expand Up @@ -208,6 +209,7 @@ macro_rules! define_aes_impl {
}

impl KeyInit for $name_dec {
#[inline]
fn new(key: &Key<Self>) -> Self {
$name_enc::new(key).into()
}
Expand Down
2 changes: 2 additions & 0 deletions aes/src/ni.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ macro_rules! define_aes_impl {
}

impl KeyInit for $name_enc {
#[inline]
fn new(key: &Key<Self>) -> Self {
// SAFETY: we enforce that this code is called only when
// target features required by `expand` were properly checked.
Expand Down Expand Up @@ -220,6 +221,7 @@ macro_rules! define_aes_impl {
}

impl KeyInit for $name_dec {
#[inline]
fn new(key: &Key<Self>) -> Self {
$name_enc::new(key).into()
}
Expand Down

0 comments on commit 2783505

Please sign in to comment.