Skip to content

aes: refactor backends#575

Open
newpavlov wants to merge 10 commits into
masterfrom
aes/ni_inline
Open

aes: refactor backends#575
newpavlov wants to merge 10 commits into
masterfrom
aes/ni_inline

Conversation

@newpavlov

@newpavlov newpavlov commented Jul 21, 2026

Copy link
Copy Markdown
Member

Simplifies and consolidates switching between backends. Fixes performance regression introduced in v0.9.

Closes #574

@newpavlov
newpavlov marked this pull request as ready for review July 21, 2026 14:07
@newpavlov
newpavlov requested a review from tarcieri July 21, 2026 14:07
Comment thread aes/src/lib.rs
impl Clone for $name {
#[inline]
fn clone(&self) -> Self {
unsafe { core::ptr::read(self) }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a little brittle. I'm surprised it isn't triggering a lint.

Comment thread aes/src/backends.rs
pub(crate) mod x86_aes;

#[cfg(all(
any(aes_backend = "avx256", aes_backend = "avx256"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be duplicated?

Suggested change
any(aes_backend = "avx256", aes_backend = "avx256"),
aes_backend = "avx256",

@tarcieri tarcieri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a nice cleanup that eliminates a lot of duplication.

My personal preference would be to land #560 first, especially as it was opened first. The two PRs together would eliminate quite a bit of duplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aes: Performance regressions from aes-0.8.x to 0.9.1 presumably due to differences in inlining on x86_64

2 participants