libtomcrypt icon indicating copy to clipboard operation
libtomcrypt copied to clipboard

Add AES-NI

Open sjaeckel opened this issue 4 years ago • 4 comments

  • [x] documentation is added or updated
  • [x] tests are added or updated

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

sjaeckel avatar Dec 21 '20 18:12 sjaeckel

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 avatar Apr 09 '21 10:04 karel-m

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.

karel-m avatar Apr 09 '21 15:04 karel-m

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 avatar Sep 01 '21 18:09 sjaeckel

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

sjaeckel avatar Sep 01 '21 18:09 sjaeckel

@sjaeckel will there be an update?

isarrider avatar Jan 03 '23 20:01 isarrider