libtomcrypt
libtomcrypt copied to clipboard
Add AES-NI
- [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
Basically fine.
I am just thinking about having:
aes_autodetect_desc
on top of:
aesni_desc
aes_desc
I have to think it over.
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.
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!?
Hah, having a second look I understand your reasoning ... I have to think about it a bit more!
@sjaeckel will there be an update?