Closed Bug 1573672 Opened 5 years ago Closed 5 years ago

Investigate performance of AES on Mac

Categories

(NSS :: Libraries, enhancement, P3)

Unspecified
macOS
enhancement

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1608493

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.

I thought that we had HW acceleration on Mac, since 3.32: https://blog.mozilla.org/security/2017/09/29/improving-aes-gcm-performance/

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

Priority: P2 → P3
Summary: MacOS builds do not use hardware AES → Investigate performance of AES on Mac
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.