xref: /qemu/crypto/meson.build (revision c7bb41b4)
1crypto_ss.add(genh)
2crypto_ss.add(files(
3  'afsplit.c',
4  'block-luks.c',
5  'block-qcow.c',
6  'block.c',
7  'cipher.c',
8  'desrfb.c',
9  'hash.c',
10  'hmac.c',
11  'ivgen-essiv.c',
12  'ivgen-plain.c',
13  'ivgen-plain64.c',
14  'ivgen.c',
15  'pbkdf.c',
16  'secret_common.c',
17  'secret.c',
18  'tlscreds.c',
19  'tlscredsanon.c',
20  'tlscredspsk.c',
21  'tlscredsx509.c',
22  'tlssession.c',
23))
24
25if 'CONFIG_NETTLE' in config_host
26  crypto_ss.add(files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'))
27elif 'CONFIG_GCRYPT' in config_host
28  crypto_ss.add(files('hash-gcrypt.c', 'pbkdf-gcrypt.c'))
29  crypto_ss.add(files('hmac-gcrypt.c'))
30else
31  crypto_ss.add(files('hash-glib.c', 'hmac-glib.c', 'pbkdf-stub.c'))
32endif
33
34crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyring.c'))
35crypto_ss.add(when: 'CONFIG_QEMU_PRIVATE_XTS', if_true: files('xts.c'))
36crypto_ss.add(when: 'CONFIG_AF_ALG', if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c'))
37crypto_ss.add(when: 'CONFIG_GNUTLS', if_true: files('tls-cipher-suites.c'))
38
39if 'CONFIG_NETTLE' in config_host
40  crypto_ss.add(nettle)
41elif 'CONFIG_GCRYPT' in config_host
42  crypto_ss.add(gcrypt)
43endif
44
45if 'CONFIG_GNUTLS' in config_host
46  crypto_ss.add(gnutls)
47endif
48
49
50util_ss.add(files('aes.c'))
51util_ss.add(files('init.c'))
52
53if 'CONFIG_GCRYPT' in config_host
54  util_ss.add(files('random-gcrypt.c'))
55elif 'CONFIG_GNUTLS' in config_host
56  util_ss.add(files('random-gnutls.c'))
57elif 'CONFIG_RNG_NONE' in config_host
58  util_ss.add(files('random-none.c'))
59else
60  util_ss.add(files('random-platform.c'))
61endif
62
63if 'CONFIG_GCRYPT' in config_host
64  util_ss.add(gcrypt)
65endif
66
67if 'CONFIG_GNUTLS' in config_host
68  util_ss.add(gnutls)
69endif
70