Skip to content

Commit

Permalink
Bug 1566124 - Optimize AES-GCM for ppc64le Differential Revision: htt…
Browse files Browse the repository at this point in the history
…ps://phabricator.services.mozilla.com/D108221 r=bbeurdouche

Differential Revision: https://phabricator.services.mozilla.com/D112302

--HG--
extra : moz-landing-system : lando
  • Loading branch information
mamonet committed May 5, 2021
1 parent 5aef4fc commit b79f0a5
Show file tree
Hide file tree
Showing 6 changed files with 1,663 additions and 6 deletions.
5 changes: 3 additions & 2 deletions lib/freebl/Makefile
Expand Up @@ -299,8 +299,9 @@ ifdef USE_64
ifeq ($(PPC_ABI),2)
ASFILES += sha512-p8.s
ifeq ($(OS_TEST),ppc64le)
EXTRA_SRCS += chacha20poly1305-ppc.c
ASFILES += chacha20-ppc64le.s
DEFINES += -DPPC_GCM
EXTRA_SRCS += chacha20poly1305-ppc.c ppc-gcm-wrap.c
ASFILES += chacha20-ppc64le.s ppc-gcm.s
endif # ppc64le
endif
endif # USE_64
Expand Down
62 changes: 58 additions & 4 deletions lib/freebl/freebl.gyp
Expand Up @@ -284,6 +284,41 @@
}]
]
},
{
'target_name': 'gcm-aes-ppc_lib',
'type': 'static_library',
'sources': [
'ppc-gcm.s',
],
'dependencies': [
'<(DEPTH)/exports.gyp:nss_exports'
],
},
{
'target_name': 'ppc-gcm-wrap-nodepend_c_lib',
'type': 'static_library',
'sources': [
'ppc-gcm-wrap.c',
],
'dependencies': [
'<(DEPTH)/exports.gyp:nss_exports',
'gcm-aes-ppc_lib',
],
},
{
'target_name': 'ppc-gcm-wrap_c_lib',
'type': 'static_library',
'sources': [
'ppc-gcm-wrap.c',
],
'dependencies': [
'<(DEPTH)/exports.gyp:nss_exports',
'gcm-aes-ppc_lib',
],
'defines!': [
'FREEBL_NO_DEPEND',
],
},
{
'target_name': 'gcm-sha512-nodepend-ppc_c_lib',
'type': 'static_library',
Expand Down Expand Up @@ -466,6 +501,7 @@
'gcm-aes-ppc_c_lib',
'gcm-sha512-ppc_c_lib',
'chacha20-ppc_lib',
'ppc-gcm-wrap_c_lib',
],
}],
[ 'disable_altivec==1 and (target_arch=="ppc64" or target_arch=="ppc64le")', {
Expand All @@ -484,6 +520,7 @@
'FREEBL_LOWHASH',
'USE_HW_AES',
'INTEL_GCM',
'PPC_GCM',
],
'conditions': [
[ 'target_arch=="x64"', {
Expand Down Expand Up @@ -535,10 +572,20 @@
'gcm-aes-aarch64_c_lib',
],
}],
[ 'disable_altivec==0 and (target_arch=="ppc64" or target_arch=="ppc64le")', {
'dependencies': [
'gcm-aes-ppc_c_lib',
'gcm-sha512-nodepend-ppc_c_lib',
[ 'disable_altivec==0', {
'conditions': [
[ 'target_arch=="ppc64"', {
'dependencies': [
'gcm-aes-ppc_c_lib',
'gcm-sha512-nodepend-ppc_c_lib',
],
}, 'target_arch=="ppc64le"', {
'dependencies': [
'gcm-aes-ppc_c_lib',
'gcm-sha512-nodepend-ppc_c_lib',
'ppc-gcm-wrap-nodepend_c_lib',
],
}],
],
}],
[ 'disable_altivec==1 and (target_arch=="ppc64" or target_arch=="ppc64le")', {
Expand Down Expand Up @@ -743,6 +790,13 @@
'FREEBL_LOWHASH',
'FREEBL_NO_DEPEND',
],
'conditions': [
[ 'disable_altivec==0 and target_arch=="ppc64le"', {
'defines': [
'PPC_GCM',
],
}],
],
}],
[ 'OS=="linux" or OS=="android"', {
'conditions': [
Expand Down

0 comments on commit b79f0a5

Please sign in to comment.