diff options
author | Lauri Kasanen <cand@gmx.com> | 2019-11-06 19:17:48 +1100 |
---|---|---|
committer | Lauri Kasanen <cand@gmx.com> | 2019-11-06 19:17:48 +1100 |
commit | a261783b1cf578ed1eb499f6ab664848b5809cca (patch) | |
tree | dd2389c38e3c1b6ed08bba3edf94ae432026e406 /lib/freebl/freebl.gyp | |
parent | 6a6666f66dd44c6abf871f00844c760dabd04349 (diff) | |
download | nss-hg-a261783b1cf578ed1eb499f6ab664848b5809cca.tar.gz |
Bug 1566126 - freebl: POWER GHASH Vector Acceleration, r=mt
Implementation for POWER8 adapted from the ARM paper:
https://conradoplg.cryptoland.net/files/2010/12/gcm14.pdf
Benchmark of `bltest -E -m aes_gcm -i tests/aes_gcm/plaintext10 \
-v tests/aes_gcm/iv10 -k tests/aes_gcm/key10 -5 10` on POWER8 3.3GHz.
NSS_DISABLE_HW_CRYPTO=1
mode in symmkey opreps cxreps context op time(sec) thrgput
aes_gcm_e 309Mb 192 5M 0 0.000 10000.000 10.001 30Mb
mode in symmkey opreps cxreps context op time(sec) thrgput
aes_gcm_e 829Mb 192 14M 0 0.000 10000.000 10.001 82Mb
Notable operf results, sw:
samples % image name symbol name
226033 59.3991 libfreeblpriv3.so bmul
80606 21.1824 libfreeblpriv3.so rijndael_encryptBlock128
28851 7.5817 libfreeblpriv3.so gcm_HashMult_sftw
hw:
213899 56.2037 libfreeblpriv3.so rijndael_encryptBlock128
45233 11.8853 libfreeblpriv3.so gcm_HashMult_hw
So the ghash part is ~5.6x faster.
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Diffstat (limited to 'lib/freebl/freebl.gyp')
-rw-r--r-- | lib/freebl/freebl.gyp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/freebl/freebl.gyp b/lib/freebl/freebl.gyp index f12508136..7ea5c3750 100644 --- a/lib/freebl/freebl.gyp +++ b/lib/freebl/freebl.gyp @@ -133,6 +133,24 @@ ] }, { + 'target_name': 'gcm-aes-ppc_c_lib', + 'type': 'static_library', + 'sources': [ + 'gcm-ppc.c' + ], + 'dependencies': [ + '<(DEPTH)/exports.gyp:nss_exports' + ], + 'cflags': [ + '-mcrypto', + '-maltivec' + ], + 'cflags_mozilla': [ + '-mcrypto', + '-maltivec' + ] + }, + { 'target_name': 'armv8_c_lib', 'type': 'static_library', 'sources': [ @@ -199,6 +217,11 @@ 'gcm-aes-aarch64_c_lib', ], }], + [ 'target_arch=="ppc64le"', { + 'dependencies': [ + 'gcm-aes-ppc_c_lib', + ], + }], [ 'OS=="linux"', { 'defines!': [ 'FREEBL_NO_DEPEND', @@ -245,6 +268,11 @@ 'gcm-aes-aarch64_c_lib', ], }], + [ 'target_arch=="ppc64" or target_arch=="ppc64le"', { + 'dependencies': [ + 'gcm-aes-ppc_c_lib', + ], + }], [ 'OS!="linux"', { 'conditions': [ [ 'moz_fold_libs==0', { |