xref: /openbmc/qemu/crypto/meson.build (revision d72c34cc)
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  if 'CONFIG_GCRYPT_HMAC' in config_host
30    crypto_ss.add(files('hmac-gcrypt.c'))
31  else
32    crypto_ss.add(files('hmac-glib.c'))
33  endif
34else
35  crypto_ss.add(files('hash-glib.c', 'hmac-glib.c', 'pbkdf-stub.c'))
36endif
37
38crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyring.c'))
39crypto_ss.add(when: 'CONFIG_QEMU_PRIVATE_XTS', if_true: files('xts.c'))
40crypto_ss.add(when: 'CONFIG_AF_ALG', if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c'))
41crypto_ss.add(when: 'CONFIG_GNUTLS', if_true: files('tls-cipher-suites.c'))
42
43if 'CONFIG_NETTLE' in config_host
44  crypto_ss.add(nettle)
45elif 'CONFIG_GCRYPT' in config_host
46  crypto_ss.add(gcrypt)
47endif
48
49if 'CONFIG_GNUTLS' in config_host
50  crypto_ss.add(gnutls)
51endif
52
53
54util_ss.add(files('aes.c'))
55util_ss.add(files('init.c'))
56
57if 'CONFIG_GCRYPT' in config_host
58  util_ss.add(files('random-gcrypt.c'))
59elif 'CONFIG_GNUTLS' in config_host
60  util_ss.add(files('random-gnutls.c'))
61elif 'CONFIG_RNG_NONE' in config_host
62  util_ss.add(files('random-none.c'))
63else
64  util_ss.add(files('random-platform.c'))
65endif
66
67if 'CONFIG_GCRYPT' in config_host
68  util_ss.add(gcrypt)
69endif
70
71if 'CONFIG_GNUTLS' in config_host
72  util_ss.add(gnutls)
73endif
74