summaryrefslogtreecommitdiffstats
path: root/security/nss/lib/freebl/freebl.gyp
diff options
context:
space:
mode:
Diffstat (limited to 'security/nss/lib/freebl/freebl.gyp')
-rw-r--r--security/nss/lib/freebl/freebl.gyp113
1 files changed, 93 insertions, 20 deletions
diff --git a/security/nss/lib/freebl/freebl.gyp b/security/nss/lib/freebl/freebl.gyp
index 8c0d0dcd5..fae56f709 100644
--- a/security/nss/lib/freebl/freebl.gyp
+++ b/security/nss/lib/freebl/freebl.gyp
@@ -10,7 +10,7 @@
'target_name': 'intel-gcm-wrap_c_lib',
'type': 'static_library',
'sources': [
- 'intel-gcm-wrap.c'
+ 'intel-gcm-wrap.c',
],
'dependencies': [
'<(DEPTH)/exports.gyp:nss_exports'
@@ -23,6 +23,69 @@
]
},
{
+ # TODO: make this so that all hardware accelerated code is in here.
+ 'target_name': 'hw-acc-crypto',
+ 'type': 'static_library',
+ 'sources': [
+ 'verified/Hacl_Chacha20_Vec128.c',
+ ],
+ 'dependencies': [
+ '<(DEPTH)/exports.gyp:nss_exports'
+ ],
+ 'conditions': [
+ [ 'target_arch=="ia32" or target_arch=="x64"', {
+ 'cflags': [
+ '-mssse3'
+ ],
+ 'cflags_mozilla': [
+ '-mssse3'
+ ],
+ # GCC doesn't define this.
+ 'defines': [
+ '__SSSE3__',
+ ],
+ }],
+ [ 'OS=="android"', {
+ # On Android we can't use any of the hardware acceleration :(
+ 'defines!': [
+ '__ARM_NEON__',
+ '__ARM_NEON',
+ ],
+ }],
+ ],
+ },
+ {
+ 'target_name': 'gcm-aes-x86_c_lib',
+ 'type': 'static_library',
+ 'sources': [
+ 'gcm-x86.c', 'aes-x86.c'
+ ],
+ 'dependencies': [
+ '<(DEPTH)/exports.gyp:nss_exports'
+ ],
+ # Enable isa option for pclmul and aes-ni; supported since gcc 4.4.
+ # This is only supported by x84/x64. It's not needed for Windows,
+ # unless clang-cl is used.
+ 'cflags_mozilla': [
+ '-mpclmul', '-maes'
+ ],
+ 'conditions': [
+ [ 'OS=="linux" or OS=="android" or OS=="dragonfly" or OS=="freebsd" or OS=="netbsd" or OS=="openbsd"', {
+ 'cflags': [
+ '-mpclmul', '-maes'
+ ],
+ }],
+ # macOS build doesn't use cflags.
+ [ 'OS=="mac"', {
+ 'xcode_settings': {
+ 'OTHER_CFLAGS': [
+ '-mpclmul', '-maes'
+ ],
+ },
+ }]
+ ]
+ },
+ {
'target_name': 'freebl',
'type': 'static_library',
'sources': [
@@ -43,8 +106,14 @@
],
'dependencies': [
'<(DEPTH)/exports.gyp:nss_exports',
+ 'hw-acc-crypto',
],
'conditions': [
+ [ 'target_arch=="ia32" or target_arch=="x64"', {
+ 'dependencies': [
+ 'gcm-aes-x86_c_lib',
+ ],
+ }],
[ 'OS=="linux"', {
'defines!': [
'FREEBL_NO_DEPEND',
@@ -74,8 +143,14 @@
],
'dependencies': [
'<(DEPTH)/exports.gyp:nss_exports',
+ 'hw-acc-crypto',
],
'conditions': [
+ [ 'target_arch=="ia32" or target_arch=="x64"', {
+ 'dependencies': [
+ 'gcm-aes-x86_c_lib',
+ ]
+ }],
[ 'OS!="linux" and OS!="android"', {
'conditions': [
[ 'moz_fold_libs==0', {
@@ -142,7 +217,8 @@
'target_defaults': {
'include_dirs': [
'mpi',
- 'ecl'
+ 'ecl',
+ 'verified',
],
'defines': [
'SHLIB_SUFFIX=\"<(dll_suffix)\"',
@@ -153,19 +229,12 @@
'MP_API_COMPATIBLE'
],
'conditions': [
- [ 'target_arch=="ia32" or target_arch=="x64"', {
- 'cflags_mozilla': [
- '-mpclmul',
- '-maes',
- ],
- }],
[ 'OS=="mac"', {
'xcode_settings': {
# I'm not sure since when this is supported.
# But I hope that doesn't matter. We also assume this is x86/x64.
'OTHER_CFLAGS': [
- '-mpclmul',
- '-maes',
+ '-std=gnu99',
],
},
}],
@@ -221,17 +290,29 @@
'HAVE_INT128_SUPPORT',
],
}, {
- 'sources': [
- 'ecl/uint128.c',
+ 'defines': [
+ 'KRML_NOUINT128',
],
}],
],
+ }, {
+ 'defines': [
+ 'KRML_NOUINT128',
+ ],
}],
[ 'OS=="linux"', {
'defines': [
'FREEBL_LOWHASH',
'FREEBL_NO_DEPEND',
],
+ 'cflags': [
+ '-std=gnu99',
+ ],
+ }],
+ [ 'OS=="dragonfly" or OS=="freebsd" or OS=="netbsd" or OS=="openbsd"', {
+ 'cflags': [
+ '-std=gnu99',
+ ],
}],
[ 'OS=="linux" or OS=="android"', {
'conditions': [
@@ -259,14 +340,6 @@
'MP_USE_UINT_DIGIT',
],
}],
- [ 'target_arch=="ia32" or target_arch=="x64"', {
- 'cflags': [
- # enable isa option for pclmul am aes-ni; supported since gcc 4.4
- # This is only support by x84/x64. It's not needed for Windows.
- '-mpclmul',
- '-maes',
- ],
- }],
[ 'target_arch=="arm"', {
'defines': [
'MP_ASSEMBLY_MULTIPLY',