xref: /openbmc/qemu/crypto/meson.build (revision 6016b7b4)
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  'hash.c',
9  'hmac.c',
10  'ivgen-essiv.c',
11  'ivgen-plain.c',
12  'ivgen-plain64.c',
13  'ivgen.c',
14  'pbkdf.c',
15  'secret_common.c',
16  'secret.c',
17  'tlscreds.c',
18  'tlscredsanon.c',
19  'tlscredspsk.c',
20  'tlscredsx509.c',
21  'tlssession.c',
22))
23
24if nettle.found()
25  crypto_ss.add(nettle, files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'))
26  if xts == 'private'
27    crypto_ss.add(files('xts.c'))
28  endif
29elif gcrypt.found()
30  crypto_ss.add(gcrypt, files('hash-gcrypt.c', 'hmac-gcrypt.c', 'pbkdf-gcrypt.c'))
31elif gnutls_crypto.found()
32  crypto_ss.add(gnutls, files('hash-gnutls.c', 'hmac-gnutls.c', 'pbkdf-gnutls.c'))
33else
34  crypto_ss.add(files('hash-glib.c', 'hmac-glib.c', 'pbkdf-stub.c'))
35endif
36
37crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyring.c'))
38crypto_ss.add(when: 'CONFIG_AF_ALG', if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c'))
39crypto_ss.add(when: gnutls, if_true: files('tls-cipher-suites.c'))
40
41util_ss.add(files('aes.c'))
42util_ss.add(files('init.c'))
43if gnutls.found()
44  util_ss.add(gnutls)
45endif
46
47if gcrypt.found()
48  util_ss.add(gcrypt, files('random-gcrypt.c'))
49elif gnutls.found()
50  util_ss.add(gnutls, files('random-gnutls.c'))
51elif 'CONFIG_RNG_NONE' in config_host
52  util_ss.add(files('random-none.c'))
53else
54  util_ss.add(files('random-platform.c'))
55endif
56
57