Investigate performance of AES on Mac
Categories
(NSS :: Libraries, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: kjacobs, Unassigned)
Details
MacOS builds use a software implementation of AES , rather than HW as used in Linux and Windows. The GAS files (intel-aes.s and intel-gcm.s) aren't directly portable, though conversion of some sort should be possible.
Using the HW implementation will give a >10x speedup.
Comment 1•5 years ago
|
||
I thought that we had HW acceleration on Mac, since 3.32: https://blog.mozilla.org/security/2017/09/29/improving-aes-gcm-performance/
Reporter | ||
Comment 2•5 years ago
|
||
Okay, we don't define USE_HW_AES
or INTEL_GCM
in Mac builds, but I see that we do wire in a function that uses AES-NI intrinsics at runtime [1], [2].
However, bltest indicates some room for investigation and improvement:
Mac host:
$ ../dist/Release/bin/bltest -E -m aes_gcm -i tmp.diff -v tmp.iv -k tmp.key -5 10
Throughput: 518Mb
Linux VM:
# ../dist/Release/bin/bltest -E -m aes_gcm -i tmp.diff -v tmp.iv -k tmp.key -5 10
Throughput: 4Gb
[1] https://searchfox.org/mozilla-central/source/security/nss/lib/freebl/rijndael.c#970
[2] https://searchfox.org/mozilla-central/source/security/nss/lib/freebl/rijndael.c#705
Reporter | ||
Updated•5 years ago
|
Description
•