1 crypto_ss = ss.source_set()
26 if 'CONFIG_GCRYPT' in config_host
27 wo_nettle = files('hash-gcrypt.c', 'pbkdf-gcrypt.c')
29 wo_nettle = files('hash-glib.c', 'pbkdf-stub.c')
31 if 'CONFIG_GCRYPT_HMAC' not in config_host
32 wo_nettle += files('hmac-glib.c')
34 crypto_ss.add(when: [nettle, 'CONFIG_NETTLE'],
35 if_true: files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'),
38 crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyring.c'))
39 crypto_ss.add(when: 'CONFIG_QEMU_PRIVATE_XTS', if_true: files('xts.c'))
40 crypto_ss.add(when: 'CONFIG_GCRYPT_HMAC', if_true: files('hmac-gcrypt.c'))
41 crypto_ss.add(when: 'CONFIG_AF_ALG', if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c'))
42 crypto_ss.add(when: 'CONFIG_GNUTLS', if_true: files('tls-cipher-suites.c'))
44 crypto_ss = crypto_ss.apply(config_host, strict: false)
45 libcrypto = static_library('crypto', crypto_ss.sources() + genh,
46 dependencies: [crypto_ss.dependencies()],
48 build_by_default: false)
50 crypto = declare_dependency(link_whole: libcrypto,
51 dependencies: [authz, qom])
53 util_ss.add(files('aes.c'))
54 util_ss.add(files('init.c'))
55 if 'CONFIG_GCRYPT' in config_host
56 util_ss.add(files('random-gcrypt.c'))
57 elif 'CONFIG_GNUTLS' in config_host
58 util_ss.add(files('random-gnutls.c'), gnutls)
59 elif 'CONFIG_RNG_NONE' in config_host
60 util_ss.add(files('random-none.c'))
62 util_ss.add(files('random-platform.c'))