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