2017-05-02 11:24:08 +00:00
|
|
|
AM_CPPFLAGS = -I$(top_srcdir)/include
|
2014-07-04 11:18:53 +00:00
|
|
|
|
2014-08-01 13:55:01 +00:00
|
|
|
EXTRA_DIST =
|
2017-04-06 19:29:11 +00:00
|
|
|
noinst_HEADERS =
|
2014-07-04 11:18:53 +00:00
|
|
|
|
2015-12-14 17:08:22 +00:00
|
|
|
if CRYB_TEST
|
|
|
|
|
2014-12-29 22:17:02 +00:00
|
|
|
# Individual libraries
|
2015-10-03 14:24:59 +00:00
|
|
|
libcipher = $(top_builddir)/lib/cipher/libcryb-cipher.la
|
2014-12-29 22:17:02 +00:00
|
|
|
libcore = $(top_builddir)/lib/core/libcryb-core.la
|
|
|
|
libdigest = $(top_builddir)/lib/digest/libcryb-digest.la
|
2015-10-03 14:24:59 +00:00
|
|
|
libenc = $(top_builddir)/lib/enc/libcryb-enc.la
|
2014-12-29 22:17:02 +00:00
|
|
|
libhash = $(top_builddir)/lib/hash/libcryb-hash.la
|
|
|
|
libmac = $(top_builddir)/lib/mac/libcryb-mac.la
|
|
|
|
libmpi = $(top_builddir)/lib/mpi/libcryb-mpi.la
|
|
|
|
liboath = $(top_builddir)/lib/oath/libcryb-oath.la
|
2015-10-03 14:24:59 +00:00
|
|
|
librand = $(top_builddir)/lib/rand/libcryb-rand.la
|
2015-10-04 07:49:48 +00:00
|
|
|
libt = $(top_builddir)/lib/test/libcryb-test.la
|
2014-07-04 11:18:53 +00:00
|
|
|
|
|
|
|
# Additional headers, flags and libraries for OpenSSL
|
2015-12-14 17:08:22 +00:00
|
|
|
if OPENSSL_TESTS
|
2017-04-29 16:28:54 +00:00
|
|
|
OPENSSL_INCLUDES =
|
2014-07-04 11:18:53 +00:00
|
|
|
OPENSSL_CFLAGS = -DWITH_OPENSSL=1
|
2014-12-29 22:17:02 +00:00
|
|
|
OPENSSL_LDADD = -lcrypto
|
2015-12-14 17:08:22 +00:00
|
|
|
endif OPENSSL_TESTS
|
2014-07-04 11:18:53 +00:00
|
|
|
|
|
|
|
# Additional headers, flags and libraries for RSAREF
|
2015-12-14 17:08:22 +00:00
|
|
|
if RSAREF_TESTS
|
2017-04-29 16:28:54 +00:00
|
|
|
RSAREF_INCLUDES = -I$(top_srcdir)/lib/rsaref
|
2014-07-04 11:18:53 +00:00
|
|
|
RSAREF_CFLAGS = -DWITH_RSAREF=1 -DPROTOTYPES=1
|
2014-12-29 22:17:02 +00:00
|
|
|
RSAREF_LDADD = $(top_builddir)/lib/rsaref/librsaref.la
|
2015-12-14 17:08:22 +00:00
|
|
|
endif RSAREF_TESTS
|
2014-07-04 11:18:53 +00:00
|
|
|
|
|
|
|
# tests
|
|
|
|
TESTS =
|
|
|
|
|
2017-01-24 14:08:48 +00:00
|
|
|
# c++ header test
|
|
|
|
TESTS += t_cxx
|
|
|
|
t_cxx_SOURCES = t_cxx.cc
|
2017-04-29 16:28:54 +00:00
|
|
|
t_cxx_CPPFLAGS = $(AM_CPPFLAGS)
|
2017-01-24 14:08:48 +00:00
|
|
|
t_cxx_LDADD =
|
|
|
|
if CRYB_CIPHER
|
|
|
|
t_cxx_CPPFLAGS += -DWITH_CRYB_CIPHER
|
|
|
|
t_cxx_LDADD += $(libcipher)
|
|
|
|
endif CRYB_CIPHER
|
|
|
|
if CRYB_CORE
|
|
|
|
t_cxx_CPPFLAGS += -DWITH_CRYB_CORE
|
|
|
|
t_cxx_LDADD += $(libcore)
|
|
|
|
endif CRYB_CORE
|
|
|
|
if CRYB_DIGEST
|
|
|
|
t_cxx_CPPFLAGS += -DWITH_CRYB_CORE
|
|
|
|
t_cxx_LDADD += $(libdigest)
|
|
|
|
endif CRYB_DIGEST
|
|
|
|
if CRYB_ENC
|
|
|
|
t_cxx_CPPFLAGS += -DWITH_CRYB_ENC
|
|
|
|
t_cxx_LDADD += $(libenc)
|
|
|
|
endif CRYB_ENC
|
|
|
|
if CRYB_HASH
|
|
|
|
t_cxx_CPPFLAGS += -DWITH_CRYB_HASH
|
|
|
|
t_cxx_LDADD += $(libhash)
|
|
|
|
endif CRYB_HASH
|
|
|
|
if CRYB_MAC
|
|
|
|
t_cxx_CPPFLAGS += -DWITH_CRYB_MAC
|
|
|
|
t_cxx_LDADD += $(libmac)
|
|
|
|
endif CRYB_MAC
|
|
|
|
if CRYB_MPI
|
|
|
|
t_cxx_CPPFLAGS += -DWITH_CRYB_MPI
|
|
|
|
t_cxx_LDADD += $(libmpi)
|
|
|
|
endif CRYB_MPI
|
|
|
|
if CRYB_OATH
|
|
|
|
t_cxx_CPPFLAGS += -DWITH_CRYB_OATH
|
|
|
|
t_cxx_LDADD += $(liboath)
|
|
|
|
endif CRYB_OATH
|
|
|
|
if CRYB_RAND
|
|
|
|
t_cxx_CPPFLAGS += -DWITH_CRYB_RAND
|
|
|
|
t_cxx_LDADD += $(librand)
|
|
|
|
endif CRYB_RAND
|
|
|
|
|
2015-10-03 14:24:59 +00:00
|
|
|
# libcryb-cipher
|
2015-12-14 17:08:22 +00:00
|
|
|
if CRYB_CIPHER
|
2016-09-17 14:14:00 +00:00
|
|
|
TESTS += t_cipher
|
|
|
|
t_cipher_LDADD = $(libt) $(libcipher)
|
2017-03-18 16:12:16 +00:00
|
|
|
TESTS += t_aes t_chacha t_des t_rc4 t_salsa
|
2015-10-03 14:24:59 +00:00
|
|
|
t_aes_LDADD = $(libt) $(libcipher)
|
2017-03-16 17:02:56 +00:00
|
|
|
t_chacha_LDADD = $(libt) $(libcipher)
|
2017-03-18 16:12:16 +00:00
|
|
|
t_des_LDADD = $(libt) $(libcipher)
|
2015-10-03 14:24:59 +00:00
|
|
|
t_rc4_LDADD = $(libt) $(libcipher)
|
2017-03-18 13:41:24 +00:00
|
|
|
t_salsa_LDADD = $(libt) $(libcipher)
|
2015-12-14 17:08:22 +00:00
|
|
|
endif CRYB_CIPHER
|
2015-10-03 14:24:59 +00:00
|
|
|
|
2014-07-04 11:18:53 +00:00
|
|
|
# libcryb-core
|
2015-12-14 17:08:22 +00:00
|
|
|
if CRYB_CORE
|
2016-09-17 14:14:00 +00:00
|
|
|
TESTS += t_core
|
|
|
|
t_core_LDADD = $(libt) $(libcore)
|
2016-11-14 11:55:33 +00:00
|
|
|
TESTS += t_assert
|
|
|
|
t_assert_LDADD = $(libt) $(libcore)
|
2015-12-15 23:50:36 +00:00
|
|
|
TESTS += t_ctype t_endian t_memcpy_s t_memset_s t_strchrnul t_strlcat t_strlcmp t_strlcpy
|
|
|
|
TESTS += t_string t_wstring
|
|
|
|
EXTRA_DIST += t__string.c
|
2014-12-29 22:17:02 +00:00
|
|
|
t_ctype_LDADD = $(libt) $(libcore)
|
|
|
|
t_endian_LDADD = $(libt) $(libcore)
|
2015-12-15 23:50:36 +00:00
|
|
|
t_memcpy_s_LDADD = $(libt) $(libcore)
|
2015-02-15 09:18:18 +00:00
|
|
|
t_memset_s_LDADD = $(libt) $(libcore)
|
2017-08-21 16:31:29 +00:00
|
|
|
t_strchrnul_LDADD = $(libt) $(libcore)
|
2014-12-29 22:17:02 +00:00
|
|
|
t_strlcat_LDADD = $(libt) $(libcore)
|
|
|
|
t_strlcmp_LDADD = $(libt) $(libcore)
|
|
|
|
t_strlcpy_LDADD = $(libt) $(libcore)
|
2017-04-21 23:41:06 +00:00
|
|
|
TESTS += t_rolror
|
|
|
|
t_rolror_LDADD = $(libt) $(libcore)
|
2016-09-17 14:14:00 +00:00
|
|
|
TESTS += t_string t_wstring
|
|
|
|
EXTRA_DIST += t__string.c
|
2014-12-29 22:17:02 +00:00
|
|
|
t_string_LDADD = $(libt) $(libcore)
|
|
|
|
t_wstring_LDADD = $(libt) $(libcore)
|
2015-12-14 17:08:22 +00:00
|
|
|
endif CRYB_CORE
|
2014-07-04 11:18:53 +00:00
|
|
|
|
|
|
|
# libcryb-digest
|
2015-12-14 17:08:22 +00:00
|
|
|
if CRYB_DIGEST
|
2016-09-17 14:14:00 +00:00
|
|
|
TESTS += t_digest
|
|
|
|
t_digest_LDADD = $(libt) $(libdigest)
|
2014-07-10 14:51:07 +00:00
|
|
|
TESTS += t_md2 t_md4 t_md5
|
2014-12-29 23:56:22 +00:00
|
|
|
t_md2_LDADD = $(libt) $(libdigest) $(RT_LIBS)
|
|
|
|
t_md4_LDADD = $(libt) $(libdigest) $(RT_LIBS)
|
|
|
|
t_md5_LDADD = $(libt) $(libdigest) $(RT_LIBS)
|
2015-12-14 17:08:22 +00:00
|
|
|
if OPENSSL_TESTS
|
2014-07-10 14:51:07 +00:00
|
|
|
TESTS += t_md4_openssl t_md5_openssl
|
|
|
|
t_md4_openssl_SOURCES = t_md4.c
|
|
|
|
t_md4_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
|
2014-12-29 23:56:22 +00:00
|
|
|
t_md4_openssl_LDADD = $(libt) $(OPENSSL_LDADD) $(RT_LIBS)
|
2014-07-04 11:18:53 +00:00
|
|
|
t_md5_openssl_SOURCES = t_md5.c
|
|
|
|
t_md5_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
|
2014-12-29 23:56:22 +00:00
|
|
|
t_md5_openssl_LDADD = $(libt) $(OPENSSL_LDADD) $(RT_LIBS)
|
2015-12-14 17:08:22 +00:00
|
|
|
endif OPENSSL_TESTS
|
|
|
|
if RSAREF_TESTS
|
2014-07-10 14:51:07 +00:00
|
|
|
TESTS += t_md2_rsaref t_md5_rsaref
|
|
|
|
t_md2_rsaref_SOURCES = t_md2.c
|
|
|
|
t_md2_rsaref_CFLAGS = $(RSAREF_INCLUDES) $(RSAREF_CFLAGS)
|
2014-12-29 23:56:22 +00:00
|
|
|
t_md2_rsaref_LDADD = $(libt) $(RSAREF_LDADD) $(RT_LIBS)
|
2014-07-04 11:18:53 +00:00
|
|
|
t_md5_rsaref_SOURCES = t_md5.c
|
|
|
|
t_md5_rsaref_CFLAGS = $(RSAREF_INCLUDES) $(RSAREF_CFLAGS)
|
2014-12-29 23:56:22 +00:00
|
|
|
t_md5_rsaref_LDADD = $(libt) $(RSAREF_LDADD) $(RT_LIBS)
|
2015-12-14 17:08:22 +00:00
|
|
|
endif RSAREF_TESTS
|
2014-07-11 13:33:58 +00:00
|
|
|
TESTS += t_sha1 t_sha224 t_sha256 t_sha384 t_sha512
|
2014-12-29 23:56:22 +00:00
|
|
|
t_sha1_LDADD = $(libt) $(libdigest) $(RT_LIBS)
|
|
|
|
t_sha224_LDADD = $(libt) $(libdigest) $(RT_LIBS)
|
|
|
|
t_sha256_LDADD = $(libt) $(libdigest) $(RT_LIBS)
|
|
|
|
t_sha384_LDADD = $(libt) $(libdigest) $(RT_LIBS)
|
|
|
|
t_sha512_LDADD = $(libt) $(libdigest) $(RT_LIBS)
|
2015-12-14 17:08:22 +00:00
|
|
|
if OPENSSL_TESTS
|
2014-07-11 13:33:58 +00:00
|
|
|
TESTS += t_sha1_openssl t_sha224_openssl t_sha256_openssl t_sha384_openssl t_sha512_openssl
|
2014-07-04 11:18:53 +00:00
|
|
|
t_sha1_openssl_SOURCES = t_sha1.c
|
|
|
|
t_sha1_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
|
2014-12-29 23:56:22 +00:00
|
|
|
t_sha1_openssl_LDADD = $(libt) $(OPENSSL_LDADD) $(RT_LIBS)
|
2014-07-10 14:51:07 +00:00
|
|
|
t_sha256_openssl_SOURCES = t_sha256.c
|
|
|
|
t_sha256_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
|
2014-12-29 23:56:22 +00:00
|
|
|
t_sha256_openssl_LDADD = $(libt) $(OPENSSL_LDADD) $(RT_LIBS)
|
2014-07-11 13:33:58 +00:00
|
|
|
t_sha224_openssl_SOURCES = t_sha224.c
|
|
|
|
t_sha224_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
|
2014-12-29 23:56:22 +00:00
|
|
|
t_sha224_openssl_LDADD = $(libt) $(OPENSSL_LDADD) $(RT_LIBS)
|
2014-07-10 14:51:07 +00:00
|
|
|
t_sha384_openssl_SOURCES = t_sha384.c
|
|
|
|
t_sha384_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
|
2014-12-29 23:56:22 +00:00
|
|
|
t_sha384_openssl_LDADD = $(libt) $(OPENSSL_LDADD) $(RT_LIBS)
|
2014-07-10 14:51:07 +00:00
|
|
|
t_sha512_openssl_SOURCES = t_sha512.c
|
|
|
|
t_sha512_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
|
2014-12-29 23:56:22 +00:00
|
|
|
t_sha512_openssl_LDADD = $(libt) $(OPENSSL_LDADD) $(RT_LIBS)
|
2015-12-14 17:08:22 +00:00
|
|
|
endif OPENSSL_TESTS
|
|
|
|
endif CRYB_DIGEST
|
2014-07-04 11:18:53 +00:00
|
|
|
|
2016-11-21 13:02:05 +00:00
|
|
|
# libcryb-enc
|
|
|
|
if CRYB_ENC
|
|
|
|
TESTS += t_enc
|
|
|
|
t_enc_LDADD = $(libt) $(libenc)
|
|
|
|
TESTS += t_rfc3986 t_rfc4648
|
|
|
|
t_rfc3986_LDADD = $(libt) $(libenc)
|
|
|
|
t_rfc4648_LDADD = $(libt) $(libenc)
|
|
|
|
endif CRYB_ENC
|
|
|
|
|
2014-07-19 06:03:57 +00:00
|
|
|
# libcryb-hash
|
2015-12-14 17:08:22 +00:00
|
|
|
if CRYB_HASH
|
2016-09-17 14:14:00 +00:00
|
|
|
TESTS += t_hash
|
|
|
|
t_hash_LDADD = $(libt) $(libhash)
|
2015-08-18 13:27:06 +00:00
|
|
|
TESTS += t_adler t_fletcher t_murmur3_32 t_pearson
|
|
|
|
t_adler_LDADD = $(libt) $(libhash)
|
2015-08-17 15:21:47 +00:00
|
|
|
t_fletcher_LDADD = $(libt) $(libhash)
|
2014-12-29 22:17:02 +00:00
|
|
|
t_murmur3_32_LDADD = $(libt) $(libhash)
|
|
|
|
t_pearson_LDADD = $(libt) $(libhash)
|
2015-12-14 17:08:22 +00:00
|
|
|
endif CRYB_HASH
|
2014-07-19 06:03:57 +00:00
|
|
|
|
2014-07-04 11:18:53 +00:00
|
|
|
# libcryb-mac
|
2015-12-14 17:08:22 +00:00
|
|
|
if CRYB_MAC
|
2016-09-17 14:14:00 +00:00
|
|
|
TESTS += t_mac
|
|
|
|
t_mac_LDADD = $(libt) $(libmac)
|
2014-07-11 13:33:58 +00:00
|
|
|
TESTS += t_hmac_sha1 t_hmac_sha224 t_hmac_sha256 t_hmac_sha384 t_hmac_sha512
|
2014-12-29 22:17:02 +00:00
|
|
|
t_hmac_sha1_LDADD = $(libt) $(libmac)
|
|
|
|
t_hmac_sha224_LDADD = $(libt) $(libmac)
|
|
|
|
t_hmac_sha256_LDADD = $(libt) $(libmac)
|
|
|
|
t_hmac_sha384_LDADD = $(libt) $(libmac)
|
|
|
|
t_hmac_sha512_LDADD = $(libt) $(libmac)
|
2015-12-14 17:08:22 +00:00
|
|
|
if OPENSSL_TESTS
|
2014-07-11 13:33:58 +00:00
|
|
|
TESTS += t_hmac_sha1_openssl t_hmac_sha224_openssl t_hmac_sha256_openssl t_hmac_sha384_openssl t_hmac_sha512_openssl
|
2014-07-10 23:57:47 +00:00
|
|
|
t_hmac_sha1_openssl_SOURCES = t_hmac_sha1.c
|
|
|
|
t_hmac_sha1_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
|
2014-12-29 22:17:02 +00:00
|
|
|
t_hmac_sha1_openssl_LDADD = $(libt) $(OPENSSL_LDADD)
|
2014-07-11 13:01:32 +00:00
|
|
|
t_hmac_sha256_openssl_SOURCES = t_hmac_sha256.c
|
|
|
|
t_hmac_sha256_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
|
2014-12-29 22:17:02 +00:00
|
|
|
t_hmac_sha256_openssl_LDADD = $(libt) $(OPENSSL_LDADD)
|
2014-07-11 13:33:58 +00:00
|
|
|
t_hmac_sha224_openssl_SOURCES = t_hmac_sha224.c
|
|
|
|
t_hmac_sha224_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
|
2014-12-29 22:17:02 +00:00
|
|
|
t_hmac_sha224_openssl_LDADD = $(libt) $(OPENSSL_LDADD)
|
2014-07-11 13:01:32 +00:00
|
|
|
t_hmac_sha384_openssl_SOURCES = t_hmac_sha384.c
|
|
|
|
t_hmac_sha384_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
|
2014-12-29 22:17:02 +00:00
|
|
|
t_hmac_sha384_openssl_LDADD = $(libt) $(OPENSSL_LDADD)
|
2014-07-11 13:01:32 +00:00
|
|
|
t_hmac_sha512_openssl_SOURCES = t_hmac_sha512.c
|
|
|
|
t_hmac_sha512_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
|
2014-12-29 22:17:02 +00:00
|
|
|
t_hmac_sha512_openssl_LDADD = $(libt) $(OPENSSL_LDADD)
|
2015-12-14 17:08:22 +00:00
|
|
|
endif OPENSSL_TESTS
|
|
|
|
endif CRYB_MAC
|
2014-07-04 11:18:53 +00:00
|
|
|
|
2014-08-12 07:30:31 +00:00
|
|
|
# libcryb-mpi
|
2015-12-14 17:08:22 +00:00
|
|
|
if CRYB_MPI
|
2017-03-29 22:53:23 +00:00
|
|
|
TESTS += t_mpi t_mpi_addsub t_mpi_compar t_mpi_gcd t_mpi_muldiv
|
2014-12-29 22:17:02 +00:00
|
|
|
t_mpi_LDADD = $(libt) $(libmpi)
|
2017-03-13 22:57:59 +00:00
|
|
|
t_mpi_addsub_LDADD = $(libt) $(libmpi)
|
|
|
|
t_mpi_compar_LDADD = $(libt) $(libmpi)
|
2017-03-29 22:53:23 +00:00
|
|
|
t_mpi_gcd_LDADD = $(libt) $(libmpi)
|
2017-03-13 22:57:59 +00:00
|
|
|
t_mpi_muldiv_LDADD = $(libt) $(libmpi)
|
2017-04-06 19:29:11 +00:00
|
|
|
noinst_HEADERS += t_mpi.h
|
2015-12-14 17:08:22 +00:00
|
|
|
endif CRYB_MPI
|
2014-08-12 07:30:31 +00:00
|
|
|
|
2016-11-21 12:48:18 +00:00
|
|
|
# libcryb-oath
|
|
|
|
if CRYB_OATH
|
|
|
|
TESTS += t_oath
|
2018-05-05 13:34:22 +00:00
|
|
|
t_oath_LDADD = $(libt) $(liboath)
|
2016-11-21 12:48:18 +00:00
|
|
|
endif CRYB_OATH
|
|
|
|
|
|
|
|
# libcryb-rand
|
|
|
|
if CRYB_RAND
|
|
|
|
TESTS += t_rand
|
|
|
|
t_rand_LDADD = $(libt) $(librand)
|
|
|
|
endif CRYB_RAND
|
|
|
|
|
2017-05-01 19:09:00 +00:00
|
|
|
# libcryb-test
|
|
|
|
if CRYB_TEST
|
|
|
|
TESTS += t_test
|
|
|
|
t_test_LDADD = $(libt) $(libtest)
|
|
|
|
TESTS += t_malloc
|
|
|
|
t_malloc_LDADD = $(libt) $(libtest)
|
|
|
|
endif CRYB_TEST
|
|
|
|
|
2014-07-04 11:18:53 +00:00
|
|
|
check_PROGRAMS = $(TESTS)
|
2015-12-14 17:08:22 +00:00
|
|
|
|
|
|
|
endif CRYB_TEST
|