2 from waflib
import Options
3 from waflib
import Errors
, Logs
7 opt
.add_option('--accel-aes',
8 help=("Should we use accelerated AES crypto functions. "
9 "Options are intelaesni|none."),
16 if conf
.CHECK_FUNCS('SHA1_Update'):
17 conf
.DEFINE('SHA1_RENAME_NEEDED', 1)
20 # --aes-accel=XXX selects accelerated AES crypto library to use, if any.
23 if Options
.options
.accel_aes
.lower() == "intelaesni":
24 Logs
.info("Attempting to compile with runtime-switchable x86_64 "
25 "Intel AES instructions. WARNING - this is temporary.")
26 elif Options
.options
.accel_aes
.lower() != "none":
27 raise Errors
.WafError("--aes-accel=%s is not a valid option. Valid "
28 "options are [none|intelaesni]" %
29 Options
.options
.accel_aes
)
35 if (bld
.CONFIG_SET("HAVE_AESNI_INTEL")
36 and not bld
.CONFIG_SET('HAVE_GNUTLS_AES_CMAC')):
37 extra_deps
+= ' aesni-intel'
39 bld
.SAMBA_SUBSYSTEM("GNUTLS_HELPERS",
42 gnutls_aead_aes_256_cbc_hmac_sha512.c
43 gnutls_arcfour_confounded_md5.c
46 deps
="gnutls samba-errors")
48 bld
.SAMBA_SUBSYSTEM("LIBCRYPTO_AES",
49 source
='aes.c rijndael-alg-fst.c',
51 enabled
=not bld
.CONFIG_SET('HAVE_GNUTLS_AES_CMAC'))
53 bld
.SAMBA_SUBSYSTEM('LIBCRYPTO_AES_CMAC',
54 source
='aes_cmac_128.c',
56 enabled
=not bld
.CONFIG_SET('HAVE_GNUTLS_AES_CMAC'))
58 bld
.SAMBA_SUBSYSTEM('LIBCRYPTO',
68 bld
.SAMBA_SUBSYSTEM('TORTURE_LIBCRYPTO_AES_CMAC',
69 source
='aes_cmac_128_test.c',
70 autoproto
='aes_cmac_test_proto.h',
72 enabled
=not bld
.CONFIG_SET('HAVE_GNUTLS_AES_CMAC'))
74 bld
.SAMBA_SUBSYSTEM('TORTURE_LIBCRYPTO',
76 autoproto
='test_proto.h',
79 TORTURE_LIBCRYPTO_AES_CMAC
82 bld
.SAMBA_PYTHON('python_crypto',
84 deps
='gnutls talloc LIBCLI_AUTH',
85 realname
='samba/crypto.so')
87 bld
.SAMBA_BINARY('test_gnutls_aead_aes_256_cbc_hmac_sha512',
90 tests/test_gnutls_aead_aes_256_cbc_hmac_sha512.c
92 deps
='cmocka gnutls samba-util samba-errors',