Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AES-NI #557

Merged
merged 5 commits into from
Jun 22, 2023
Merged

Add AES-NI #557

merged 5 commits into from
Jun 22, 2023

Conversation

sjaeckel
Copy link
Member

  • documentation is added or updated
  • tests are added or updated

This PR adds support for the AES-NI instructions as discussed in e.g. #480 or #551

@karel-m
Copy link
Member

karel-m commented Apr 9, 2021

Basically fine.

I am just thinking about having:

aes_autodetect_desc

on top of:

aesni_desc
aes_desc

I have to think it over.

@karel-m
Copy link
Member

karel-m commented Apr 9, 2021

Or even:

aesni_desc      (new AES-NI)
aessw_desc      (old SW implementation aes_desc renamed to aessw_desc)
aes_desc        (aes with runtime autodetection of aessw/aesni variant)

With this all calls like find_cipher("aes") (we have it at many places) will choose autodetected aessw/aesni variant.

@sjaeckel
Copy link
Member Author

sjaeckel commented Sep 1, 2021

aesni_desc      (new AES-NI)
aessw_desc      (old SW implementation aes_desc renamed to aessw_desc)
aes_desc        (aes with runtime autodetection of aessw/aesni variant)

With this all calls like find_cipher("aes") (we have it at many places) will choose autodetected aessw/aesni variant.

I like the idea but what's the purpose of the aesni_desc? It should still check whether the CPU has support as otherwise bad things will happen.

My proposal would therefor be to make aesni the new default:

aes_desc        (aes with runtime autodetection of aessw/aesni variant)
aessw_desc      (old SW implementation aes_desc renamed to aessw_desc)

What do you think?

I'm having an early WIP about adding support for the AES instructions on ARMv8, there we could then basically use the same pattern and add a aes_arm.c which provides aes_desc and also does autodetection!?

@sjaeckel
Copy link
Member Author

sjaeckel commented Sep 1, 2021

Hah, having a second look I understand your reasoning ... I have to think about it a bit more!

@isarrider
Copy link

@sjaeckel will there be an update?

@sjaeckel sjaeckel force-pushed the add-aesni branch 5 times, most recently from 308ca3d to c816b13 Compare June 21, 2023 17:55
sjaeckel added 5 commits June 22, 2023 18:37
Signed-off-by: Steffen Jaeckel <[email protected]>
Signed-off-by: Steffen Jaeckel <[email protected]>
`aes_desc` and `aes_enc_desc` now do auto-detection of the best suitable
AES implementation for the platform.

Signed-off-by: Steffen Jaeckel <[email protected]>
Signed-off-by: Steffen Jaeckel <[email protected]>
@sjaeckel sjaeckel merged commit 1e629e6 into develop Jun 22, 2023
@sjaeckel sjaeckel deleted the add-aesni branch June 22, 2023 17:15
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.

3 participants