Messages in this thread | | | Date | Fri, 26 Apr 2019 14:02:35 -0400 | From | "Theodore Ts'o" <> | Subject | Re: [PATCH] x86/entry/64: randomize kernel stack offset upon syscall |
| |
On Fri, Apr 26, 2019 at 10:44:20AM -0700, Eric Biggers wrote: > Would it be possibly to call ChaCha20 through the actual crypto API so that SIMD > instructions (e.g. AVX-2) could be used? That would make it *much* faster. > Also consider AES-CTR with AES-NI instructions.
It's not obvious SIMD instructions will be faster in practice, since it requires saving and restoring the vector/FPU registers. If you're going to be doing a *lot* of vector processing (for example when doing block-level RAID-5 / RAID-6 computations), it might be worth it. But if you're only going to be turning the crank for 12 or 20 rounds, the overhead of calling kernel_fpu_begin() and kernel_fpu_end() is probably going to make this worth it.
As far as using aesni (if available) is concerned, since we don't need to worry about interoperability between two systems ala IPSEC, it's definitely something that's worth investigating.
- Ted
| |