diff options
author | Jeremy Allison <jra@samba.org> | 2017-09-06 11:59:44 -0700 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2017-09-11 01:18:19 +0200 |
commit | a1aa3f49bf348e2c9bbfd23a04b973b2b1e03c6b (patch) | |
tree | 84f04414b3c00428223b2505be1b524443d7d56d /lib | |
parent | 9d193a942fdbcab135e40d06422eab640d33d00b (diff) | |
download | samba-a1aa3f49bf348e2c9bbfd23a04b973b2b1e03c6b.tar.gz |
lib: crypto: Add the ability to select Intel AESNI instruction set at configure time.
Add --accel-aes=[none|intelaesni] to select.
Default is none.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13008
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 5f87a05aa314776135eec1057dd644c0b25a9d14)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/crypto/wscript | 6 | ||||
-rw-r--r-- | lib/crypto/wscript_configure | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/lib/crypto/wscript b/lib/crypto/wscript new file mode 100644 index 00000000000..c3708c7560e --- /dev/null +++ b/lib/crypto/wscript @@ -0,0 +1,6 @@ +#!/usr/bin/env python + +def set_options(opt): + opt.add_option('--accel-aes', + help=("Should we use accelerated AES crypto functions. Options are intelaesni|none."), + action="store", dest='accel_aes', default="none") diff --git a/lib/crypto/wscript_configure b/lib/crypto/wscript_configure index 130acec4381..9fdaf9f3d14 100644 --- a/lib/crypto/wscript_configure +++ b/lib/crypto/wscript_configure @@ -1,3 +1,7 @@ +#!/usr/bin/env python +import Options +import Utils + if not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h', checklibc=True): conf.CHECK_FUNCS_IN('MD5Init', 'md5', headers='sys/md5.h', @@ -13,3 +17,12 @@ if conf.CHECK_FUNCS('SHA256_Update'): conf.DEFINE('SHA256_RENAME_NEEDED', 1) if conf.CHECK_FUNCS('SHA512_Update'): conf.DEFINE('SHA512_RENAME_NEEDED', 1) + +# +# --aes-accel=XXX selects accelerated AES crypto library to use, if any. +# Default is none. +# +if Options.options.accel_aes.lower() == "intelaesni": + print("Attempting to compile with runtime-switchable x86_64 Intel AES instructions. WARNING - this is temporary.") +elif Options.options.accel_aes.lower() != "none": + raise Utils.WafError('--aes-accel=%s is not a valid option. Valid options are [none|intelaesni]' % Options.options.accel_aes) |