]> pd.if.org Git - zpackage/commitdiff
add targets for tls and libtom
authorNathan Wagner <nw@hydaspes.if.org>
Wed, 6 Feb 2019 02:43:47 +0000 (02:43 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Wed, 6 Feb 2019 02:43:47 +0000 (02:43 +0000)
Makefile

index c135bad4aef0f466087ab844d2699399234e532d..5ffd76bac2b5d4a4f30a1acd2d63eee87f2589ba 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,8 @@
 CC=clang --target=x86_64-pc-linux-musl
+CC=/usr/musl/bin/musl-clang
 #CC=/usr/musl/bin/musl-gcc
-CFLAGS=-Wall -W -Wextra -Werror -Wno-implicit-fallthrough -std=c99 -Ilib -Isqlite -Ielf -I. -Ilzma/api --target=x86_64-pc-linux-musl
+#CFLAGS=-Wall -W -Wextra -Werror -Wno-implicit-fallthrough -std=c99 -Ilib -Isqlite -Ielf -I. -Ilzma/api --target=x86_64-pc-linux-musl
+CFLAGS=-Wall -W -Wextra -Werror -Wno-implicit-fallthrough -std=c99 -Ilib -Isqlite -Ielf -I. -Ilzma/api
 
 ZPMVER:=$(shell git describe --tags --match 'v[0-9]*' | sed -e 's/^v//' | sed -e 's/-g.\+//' | sed -e 's/-/./g')
 
@@ -178,7 +180,7 @@ sqlite/sqlite3.o: sqlite/sqlite3.c sqlite/config.h
        $(CC) -O3 -Wall -std=c99 -Ilib -D_HAVE_SQLITE_CONFIG_H=1 -c -o $@ $<
 
 sqlite/extensions.o: sqlite/extensions.c
-       $(CC) -O3 -Wall -std=c99 -I. -DSQLITE_CORE=1 -c -o $@ $<
+       $(CC) -O3 -Wall -std=c99 -I. -Isqlite -DSQLITE_CORE=1 -c -o $@ $<
 
 sqlite/shell.o: sqlite/shell.c sqlite/config.h Makefile
        $(CC) -Wall -std=c99 -Ilib \
@@ -223,9 +225,544 @@ fe_sub.o \
 fe_tobytes.o \
 scalarmult.o
 
-x25519.o: $(addprefix crypto/ref10/, $(X255OBJ))
+TLSOBJ= tlse.o x25519.o chacha.o base64.o pem.o forward.o handshake.o \
+       buffer.o parse_client_hello.o parse_message.o cipher_supported.o \
+       packet_update.o hmac_message.o hkdf.o hash.o
+
+crypto/x25519.o: $(addprefix crypto/ref10/, $(X255OBJ))
+       ld -o $@ -r $+
+
+crypto/%.o: CFLAGS+=-Icrypto -DTFM_DESC -DTFM_NO_ASM -Itomsfastmath/src/headers \
+       -Wno-pointer-sign -Wno-missing-braces -Ilibtomcrypt/src/headers
+
+#      /usr/musl/bin/musl-clang -Wall -Wextra -Wno-missing-braces -Werror -Wno-pointer-sign -I. -DTFM_DESC -DTFM_NO_ASM -I ../libtomcrypt/src/headers -I ../tomsfastmath/src/headers -DSTRICT_TLS -DIGNORE_SESSION_ID --rtlib=compiler-rt   -c -o tlse.o tlse.c
+
+#/usr/musl/bin/musl-clang -Wall -Wextra -Wno-missing-braces -Werror -Wno-pointer-sign -I. -DTFM_DESC -DTFM_NO_ASM -I ../libtomcrypt/src/headers -I ../tomsfastmath/src/headers -DSTRICT_TLS -DIGNORE_SESSION_ID --rtlib=compiler-rt   -c -o tlse.o tlse.c
+
+tls.o: $(addprefix crypto/, $(TLSOBJ))
+       ld -o $@ -r $+
+
+TFMOBJ= \
+   addsub/fp_add.o \
+   addsub/fp_add_d.o \
+   addsub/fp_addmod.o \
+   addsub/fp_cmp.o \
+   addsub/fp_cmp_d.o \
+   addsub/fp_cmp_mag.o \
+   addsub/fp_sub.o \
+   addsub/fp_sub_d.o \
+   addsub/fp_submod.o \
+   addsub/s_fp_add.o \
+   addsub/s_fp_sub.o \
+   bin/fp_radix_size.o \
+   bin/fp_read_radix.o \
+   bin/fp_read_signed_bin.o \
+   bin/fp_reverse.o \
+   bin/fp_read_unsigned_bin.o \
+   bin/fp_signed_bin_size.o \
+   bin/fp_s_rmap.o \
+   bin/fp_toradix.o \
+   bin/fp_toradix_n.o \
+   bin/fp_to_signed_bin.o \
+   bin/fp_to_unsigned_bin.o \
+   bin/fp_unsigned_bin_size.o \
+   bit/fp_cnt_lsb.o \
+   bit/fp_count_bits.o \
+   bit/fp_div_2.o \
+   bit/fp_div_2d.o \
+   bit/fp_lshd.o \
+   bit/fp_mod_2d.o \
+   bit/fp_rshd.o \
+   divide/fp_div.o \
+   divide/fp_div_d.o \
+   divide/fp_mod.o \
+   divide/fp_mod_d.o \
+   exptmod/fp_2expt.o \
+   exptmod/fp_exptmod.o \
+   misc/fp_ident.o \
+   misc/fp_rand.o \
+   misc/fp_set.o \
+   mont/fp_montgomery_calc_normalization.o \
+   mont/fp_montgomery_reduce.o \
+   mont/fp_montgomery_setup.o \
+   mul/fp_mul_2.o \
+   mul/fp_mul_2d.o \
+   mul/fp_mul.o \
+   mul/fp_mul_comba_12.o \
+   mul/fp_mul_comba_17.o \
+   mul/fp_mul_comba_20.o \
+   mul/fp_mul_comba_24.o \
+   mul/fp_mul_comba_28.o \
+   mul/fp_mul_comba_32.o \
+   mul/fp_mul_comba_3.o \
+   mul/fp_mul_comba_48.o \
+   mul/fp_mul_comba_4.o \
+   mul/fp_mul_comba_64.o \
+   mul/fp_mul_comba_6.o \
+   mul/fp_mul_comba_7.o \
+   mul/fp_mul_comba_8.o \
+   mul/fp_mul_comba.o \
+   mul/fp_mul_comba_small_set.o \
+   mul/fp_mul_d.o \
+   mul/fp_mul_comba_9.o \
+   mul/fp_mulmod.o \
+   numtheory/fp_gcd.o \
+   numtheory/fp_invmod.o \
+   numtheory/fp_isprime.o \
+   numtheory/fp_isprime_ex.o \
+   numtheory/fp_lcm.o \
+   numtheory/fp_prime_miller_rabin.o \
+   numtheory/fp_prime_random_ex.o \
+   sqr/fp_sqr.o \
+   sqr/fp_sqr_comba_12.o \
+   sqr/fp_sqr_comba_17.o \
+   sqr/fp_sqr_comba_20.o \
+   sqr/fp_sqr_comba_24.o \
+   sqr/fp_sqr_comba_28.o \
+   sqr/fp_sqr_comba_32.o \
+   sqr/fp_sqr_comba_48.o \
+   sqr/fp_sqr_comba_3.o \
+   sqr/fp_sqr_comba_4.o \
+   sqr/fp_sqr_comba_64.o \
+   sqr/fp_sqr_comba_6.o \
+   sqr/fp_sqr_comba_7.o \
+   sqr/fp_sqr_comba_8.o \
+   sqr/fp_sqr_comba_9.o \
+   sqr/fp_sqr_comba.o \
+   sqr/fp_sqr_comba_generic.o \
+   sqr/fp_sqr_comba_small_set.o \
+   sqr/fp_sqrmod.o
+
+tomsfastmath/src/addsub/%.o: CFLAGS+=-DTFM_DESC -DTFM_NO_ASM -Itomsfastmath/src/headers -DARGTYPE=4
+tomsfastmath/src/%.o: CFLAGS+=-DTFM_DESC -DTFM_NO_ASM -Itomsfastmath/src/headers -DARGTYPE=4
+
+tfm.o: $(addprefix tomsfastmath/src/, $(TFMOBJ))
+       ld -o $@ -r $+
+
+LTCOBJ= \
+   ciphers/aes/aes.o \
+   ciphers/anubis.o \
+   ciphers/blowfish.o \
+   ciphers/camellia.o \
+   ciphers/cast5.o \
+   ciphers/des.o \
+   ciphers/kasumi.o \
+   ciphers/khazad.o \
+   ciphers/kseed.o \
+   ciphers/multi2.o \
+   ciphers/noekeon.o \
+   ciphers/rc2.o \
+   ciphers/rc5.o \
+   ciphers/rc6.o \
+   ciphers/safer/safer.o \
+   ciphers/safer/saferp.o \
+   ciphers/skipjack.o \
+   ciphers/twofish/twofish.o \
+   ciphers/xtea.o \
+   encauth/ccm/ccm_add_aad.o \
+   encauth/ccm/ccm_add_nonce.o \
+   encauth/ccm/ccm_done.o \
+   encauth/ccm/ccm_init.o \
+   encauth/ccm/ccm_memory.o \
+   encauth/ccm/ccm_process.o \
+   encauth/ccm/ccm_reset.o \
+   encauth/ccm/ccm_test.o \
+   encauth/chachapoly/chacha20poly1305_add_aad.o \
+   encauth/chachapoly/chacha20poly1305_decrypt.o \
+   encauth/chachapoly/chacha20poly1305_done.o \
+   encauth/chachapoly/chacha20poly1305_encrypt.o \
+   encauth/chachapoly/chacha20poly1305_init.o \
+   encauth/chachapoly/chacha20poly1305_memory.o \
+   encauth/chachapoly/chacha20poly1305_setiv.o \
+   encauth/chachapoly/chacha20poly1305_setiv_rfc7905.o \
+   encauth/chachapoly/chacha20poly1305_test.o \
+   encauth/eax/eax_addheader.o \
+   encauth/eax/eax_decrypt.o \
+   encauth/eax/eax_decrypt_verify_memory.o \
+   encauth/eax/eax_done.o \
+   encauth/eax/eax_encrypt.o \
+   encauth/eax/eax_encrypt_authenticate_memory.o \
+   encauth/eax/eax_init.o \
+   encauth/eax/eax_test.o \
+   encauth/gcm/gcm_add_aad.o \
+   encauth/gcm/gcm_add_iv.o \
+   encauth/gcm/gcm_done.o \
+   encauth/gcm/gcm_gf_mult.o \
+   encauth/gcm/gcm_init.o \
+   encauth/gcm/gcm_memory.o \
+   encauth/gcm/gcm_mult_h.o \
+   encauth/gcm/gcm_process.o \
+   encauth/gcm/gcm_reset.o \
+   encauth/gcm/gcm_test.o \
+   misc/crypt/crypt_find_cipher_id.o \
+   misc/crypt/crypt_find_hash_any.o \
+   misc/crypt/crypt_find_hash.o \
+   encauth/ocb/ocb_decrypt.o \
+   encauth/ocb/ocb_decrypt_verify_memory.o \
+   encauth/ocb/ocb_done_decrypt.o \
+   encauth/ocb/ocb_done_encrypt.o \
+   misc/crypt/crypt_find_hash_id.o \
+   misc/crypt/crypt_find_hash_oid.o \
+   encauth/ocb/ocb_encrypt.o \
+   encauth/ocb/ocb_encrypt_authenticate_memory.o \
+   encauth/ocb/ocb_init.o \
+   encauth/ocb/ocb_ntz.o \
+   encauth/ocb/ocb_shift_xor.o \
+   encauth/ocb/ocb_test.o \
+   encauth/ocb/s_ocb_done.o \
+   encauth/ocb3/ocb3_add_aad.o \
+   encauth/ocb3/ocb3_decrypt.o \
+   encauth/ocb3/ocb3_decrypt_last.o \
+   encauth/ocb3/ocb3_decrypt_verify_memory.o \
+   encauth/ocb3/ocb3_done.o \
+   encauth/ocb3/ocb3_encrypt.o \
+   encauth/ocb3/ocb3_encrypt_authenticate_memory.o \
+   encauth/ocb3/ocb3_encrypt_last.o \
+   encauth/ocb3/ocb3_init.o \
+   encauth/ocb3/ocb3_int_ntz.o \
+   encauth/ocb3/ocb3_int_xor_blocks.o \
+   encauth/ocb3/ocb3_test.o \
+   hashes/blake2b.o \
+   hashes/blake2s.o \
+   hashes/chc/chc.o \
+   hashes/helper/hash_file.o \
+   hashes/helper/hash_filehandle.o \
+   hashes/helper/hash_memory.o \
+   hashes/helper/hash_memory_multi.o \
+   hashes/md2.o \
+   hashes/md4.o \
+   hashes/md5.o \
+   hashes/rmd128.o \
+   hashes/rmd160.o \
+   hashes/rmd256.o \
+   hashes/rmd320.o \
+   hashes/sha1.o \
+   hashes/sha2/sha224.o \
+   hashes/sha2/sha256.o \
+   hashes/sha2/sha384.o \
+   hashes/sha2/sha512.o \
+   hashes/sha2/sha512_224.o \
+   hashes/sha2/sha512_256.o \
+   hashes/sha3.o \
+   hashes/sha3_test.o \
+   hashes/tiger.o \
+   hashes/whirl/whirl.o \
+   mac/blake2/blake2bmac.o \
+   mac/blake2/blake2bmac_file.o \
+   mac/blake2/blake2bmac_memory.o \
+   mac/blake2/blake2bmac_memory_multi.o \
+   mac/blake2/blake2bmac_test.o \
+   mac/blake2/blake2smac.o \
+   mac/blake2/blake2smac_file.o \
+   mac/blake2/blake2smac_memory.o \
+   mac/blake2/blake2smac_memory_multi.o \
+   mac/blake2/blake2smac_test.o \
+   mac/f9/f9_done.o \
+   mac/f9/f9_file.o \
+   mac/f9/f9_init.o \
+   mac/f9/f9_memory.o \
+   mac/f9/f9_memory_multi.o \
+   mac/f9/f9_process.o \
+   mac/f9/f9_test.o \
+   mac/hmac/hmac_done.o \
+   mac/hmac/hmac_file.o \
+   mac/hmac/hmac_init.o \
+   mac/hmac/hmac_memory.o \
+   mac/hmac/hmac_memory_multi.o \
+   mac/hmac/hmac_process.o \
+   mac/hmac/hmac_test.o \
+   mac/omac/omac_done.o \
+   mac/omac/omac_file.o \
+   mac/omac/omac_init.o \
+   mac/omac/omac_memory.o \
+   mac/omac/omac_memory_multi.o \
+   mac/omac/omac_process.o \
+   misc/crypt/crypt_find_prng.o \
+   mac/omac/omac_test.o \
+   mac/pelican/pelican.o \
+   mac/pelican/pelican_memory.o \
+   mac/pelican/pelican_test.o \
+   mac/pmac/pmac_done.o \
+   mac/pmac/pmac_file.o \
+   mac/pmac/pmac_init.o \
+   mac/pmac/pmac_memory.o \
+   mac/pmac/pmac_memory_multi.o \
+   mac/pmac/pmac_ntz.o \
+   mac/pmac/pmac_process.o \
+   mac/pmac/pmac_shift_xor.o \
+   mac/pmac/pmac_test.o \
+   mac/poly1305/poly1305.o \
+   mac/poly1305/poly1305_file.o \
+   mac/poly1305/poly1305_memory.o \
+   mac/poly1305/poly1305_memory_multi.o \
+   mac/poly1305/poly1305_test.o \
+   mac/xcbc/xcbc_done.o \
+   mac/xcbc/xcbc_file.o \
+   mac/xcbc/xcbc_init.o \
+   mac/xcbc/xcbc_memory.o \
+   mac/xcbc/xcbc_memory_multi.o \
+   mac/xcbc/xcbc_process.o \
+   mac/xcbc/xcbc_test.o \
+   math/fp/ltc_ecc_fp_mulmod.o \
+   math/gmp_desc.o \
+   math/ltm_desc.o \
+   math/multi.o \
+   math/radix_to_bin.o \
+   math/rand_bn.o \
+   math/rand_prime.o \
+   math/tfm_desc.o \
+   misc/adler32.o \
+   misc/base64/base64_decode.o \
+   misc/base64/base64_encode.o \
+   misc/burn_stack.o \
+   misc/compare_testvector.o \
+   misc/crc32.o \
+   misc/crypt/crypt.o \
+   misc/crypt/crypt_argchk.o \
+   misc/crypt/crypt_cipher_descriptor.o \
+   misc/crypt/crypt_cipher_is_valid.o \
+   misc/crypt/crypt_constants.o \
+   misc/crypt/crypt_find_cipher.o \
+   misc/crypt/crypt_find_cipher_any.o \
+   misc/crypt/crypt_fsa.o \
+   misc/crypt/crypt_hash_descriptor.o \
+   misc/crypt/crypt_hash_is_valid.o \
+   misc/crypt/crypt_inits.o \
+   misc/crypt/crypt_ltc_mp_descriptor.o \
+   misc/crypt/crypt_prng_descriptor.o \
+   misc/crypt/crypt_prng_is_valid.o \
+   misc/crypt/crypt_prng_rng_descriptor.o \
+   misc/crypt/crypt_register_all_ciphers.o \
+   misc/crypt/crypt_register_all_hashes.o \
+   misc/crypt/crypt_register_all_prngs.o \
+   misc/crypt/crypt_register_cipher.o \
+   misc/crypt/crypt_register_hash.o \
+   misc/crypt/crypt_register_prng.o \
+   misc/crypt/crypt_sizes.o \
+   misc/crypt/crypt_unregister_cipher.o \
+   misc/crypt/crypt_unregister_hash.o \
+   misc/crypt/crypt_unregister_prng.o \
+   misc/error_to_string.o \
+   misc/hkdf/hkdf.o \
+   misc/hkdf/hkdf_test.o \
+   misc/mem_neq.o \
+   misc/pk_get_oid.o \
+   misc/pkcs5/pkcs_5_1.o \
+   misc/pkcs5/pkcs_5_2.o \
+   misc/pkcs5/pkcs_5_test.o \
+   misc/zeromem.o \
+   modes/cbc/cbc_decrypt.o \
+   modes/cbc/cbc_done.o \
+   modes/cbc/cbc_encrypt.o \
+   modes/cbc/cbc_getiv.o \
+   modes/cbc/cbc_setiv.o \
+   modes/cbc/cbc_start.o \
+   modes/cfb/cfb_decrypt.o \
+   modes/cfb/cfb_done.o \
+   modes/cfb/cfb_encrypt.o \
+   modes/cfb/cfb_getiv.o \
+   modes/cfb/cfb_setiv.o \
+   modes/cfb/cfb_start.o \
+   modes/ctr/ctr_decrypt.o \
+   modes/ctr/ctr_done.o \
+   modes/ctr/ctr_encrypt.o \
+   modes/ctr/ctr_getiv.o \
+   modes/ctr/ctr_setiv.o \
+   modes/ctr/ctr_start.o \
+   modes/ctr/ctr_test.o \
+   modes/ecb/ecb_decrypt.o \
+   modes/ecb/ecb_done.o \
+   modes/ecb/ecb_encrypt.o \
+   modes/ecb/ecb_start.o \
+   modes/f8/f8_decrypt.o \
+   modes/f8/f8_done.o \
+   modes/f8/f8_encrypt.o \
+   modes/f8/f8_getiv.o \
+   modes/f8/f8_setiv.o \
+   modes/f8/f8_start.o \
+   modes/f8/f8_test_mode.o \
+   modes/lrw/lrw_decrypt.o \
+   modes/lrw/lrw_done.o \
+   modes/lrw/lrw_encrypt.o \
+   modes/lrw/lrw_getiv.o \
+   modes/lrw/lrw_process.o \
+   modes/lrw/lrw_start.o \
+   modes/lrw/lrw_setiv.o \
+   modes/lrw/lrw_test.o \
+   modes/ofb/ofb_decrypt.o \
+   modes/ofb/ofb_done.o \
+   modes/ofb/ofb_encrypt.o \
+   modes/ofb/ofb_getiv.o \
+   modes/ofb/ofb_setiv.o \
+   modes/ofb/ofb_start.o \
+   modes/xts/xts_decrypt.o \
+   modes/xts/xts_done.o \
+   modes/xts/xts_encrypt.o \
+   modes/xts/xts_init.o \
+   modes/xts/xts_mult_x.o \
+   modes/xts/xts_test.o \
+   pk/asn1/der/bit/der_decode_bit_string.o \
+   pk/asn1/der/bit/der_decode_raw_bit_string.o \
+   pk/asn1/der/bit/der_encode_bit_string.o \
+   pk/asn1/der/bit/der_encode_raw_bit_string.o \
+   pk/asn1/der/bit/der_length_bit_string.o \
+   pk/asn1/der/boolean/der_decode_boolean.o \
+   pk/asn1/der/boolean/der_encode_boolean.o \
+   pk/asn1/der/boolean/der_length_boolean.o \
+   pk/asn1/der/choice/der_decode_choice.o \
+   pk/asn1/der/generalizedtime/der_decode_generalizedtime.o \
+   pk/asn1/der/generalizedtime/der_encode_generalizedtime.o \
+   pk/asn1/der/generalizedtime/der_length_generalizedtime.o \
+   pk/asn1/der/ia5/der_decode_ia5_string.o \
+   pk/asn1/der/ia5/der_encode_ia5_string.o \
+   pk/asn1/der/ia5/der_length_ia5_string.o \
+   pk/asn1/der/integer/der_decode_integer.o \
+   pk/asn1/der/integer/der_encode_integer.o \
+   pk/asn1/der/integer/der_length_integer.o \
+   pk/asn1/der/object_identifier/der_decode_object_identifier.o \
+   pk/asn1/der/object_identifier/der_encode_object_identifier.o \
+   pk/asn1/der/object_identifier/der_length_object_identifier.o \
+   pk/asn1/der/octet/der_decode_octet_string.o \
+   pk/asn1/der/octet/der_encode_octet_string.o \
+   pk/asn1/der/octet/der_length_octet_string.o \
+   pk/asn1/der/printable_string/der_decode_printable_string.o \
+   pk/asn1/der/printable_string/der_encode_printable_string.o \
+   pk/asn1/der/printable_string/der_length_printable_string.o \
+   pk/asn1/der/sequence/der_decode_sequence_ex.o \
+   pk/asn1/der/sequence/der_decode_sequence_flexi.o \
+   pk/asn1/der/sequence/der_decode_sequence_multi.o \
+   pk/asn1/der/sequence/der_decode_subject_public_key_info.o \
+   pk/asn1/der/sequence/der_encode_sequence_ex.o \
+   pk/asn1/der/sequence/der_encode_sequence_multi.o \
+   pk/asn1/der/sequence/der_encode_subject_public_key_info.o \
+   pk/asn1/der/sequence/der_length_sequence.o \
+   pk/asn1/der/sequence/der_sequence_free.o \
+   pk/asn1/der/sequence/der_sequence_shrink.o \
+   pk/asn1/der/set/der_encode_set.o \
+   pk/asn1/der/set/der_encode_setof.o \
+   pk/asn1/der/short_integer/der_decode_short_integer.o \
+   pk/asn1/der/short_integer/der_encode_short_integer.o \
+   pk/asn1/der/short_integer/der_length_short_integer.o \
+   pk/asn1/der/teletex_string/der_decode_teletex_string.o \
+   pk/asn1/der/teletex_string/der_length_teletex_string.o \
+   pk/asn1/der/utctime/der_decode_utctime.o \
+   pk/asn1/der/utctime/der_encode_utctime.o \
+   pk/asn1/der/utf8/der_decode_utf8_string.o \
+   pk/asn1/der/utctime/der_length_utctime.o \
+   pk/asn1/der/utf8/der_encode_utf8_string.o \
+   pk/asn1/der/utf8/der_length_utf8_string.o \
+   pk/dh/dh.o \
+   pk/dh/dh_check_pubkey.o \
+   pk/dh/dh_export.o \
+   pk/dh/dh_export_key.o \
+   pk/dh/dh_free.o \
+   pk/dh/dh_generate_key.o \
+   pk/dh/dh_import.o \
+   pk/dh/dh_set.o \
+   pk/dh/dh_set_pg_dhparam.o \
+   pk/dh/dh_shared_secret.o \
+   pk/dsa/dsa_decrypt_key.o \
+   pk/dsa/dsa_encrypt_key.o \
+   pk/dsa/dsa_export.o \
+   pk/dsa/dsa_generate_key.o \
+   pk/dsa/dsa_generate_pqg.o \
+   pk/dsa/dsa_free.o \
+   pk/dsa/dsa_import.o \
+   pk/dsa/dsa_make_key.o \
+   pk/dsa/dsa_set.o \
+   pk/dsa/dsa_set_pqg_dsaparam.o \
+   pk/dsa/dsa_shared_secret.o \
+   pk/dsa/dsa_sign_hash.o \
+   pk/dsa/dsa_verify_hash.o \
+   pk/dsa/dsa_verify_key.o \
+   pk/ecc/ecc.o \
+   pk/ecc/ecc_ansi_x963_export.o \
+   pk/ecc/ecc_ansi_x963_import.o \
+   pk/ecc/ecc_decrypt_key.o \
+   pk/ecc/ecc_encrypt_key.o \
+   pk/ecc/ecc_export.o \
+   pk/ecc/ecc_free.o \
+   pk/ecc/ecc_get_size.o \
+   pk/ecc/ecc_import.o \
+   pk/ecc/ecc_make_key.o \
+   pk/ecc/ecc_shared_secret.o \
+   pk/ecc/ecc_sign_hash.o \
+   pk/ecc/ecc_sizes.o \
+   pk/ecc/ecc_test.o \
+   pk/ecc/ecc_verify_hash.o \
+   pk/ecc/ltc_ecc_map.o \
+   pk/ecc/ltc_ecc_is_valid_idx.o \
+   pk/ecc/ltc_ecc_mul2add.o \
+   pk/ecc/ltc_ecc_mulmod.o \
+   pk/ecc/ltc_ecc_mulmod_timing.o \
+   pk/ecc/ltc_ecc_points.o \
+   pk/ecc/ltc_ecc_projective_add_point.o \
+   pk/ecc/ltc_ecc_projective_dbl_point.o \
+   pk/katja/katja_decrypt_key.o \
+   pk/katja/katja_encrypt_key.o \
+   pk/katja/katja_export.o \
+   pk/katja/katja_exptmod.o \
+   pk/katja/katja_free.o \
+   pk/katja/katja_import.o \
+   pk/katja/katja_make_key.o \
+   pk/pkcs1/pkcs_1_i2osp.o \
+   pk/pkcs1/pkcs_1_mgf1.o \
+   pk/pkcs1/pkcs_1_oaep_decode.o \
+   pk/pkcs1/pkcs_1_oaep_encode.o \
+   pk/pkcs1/pkcs_1_os2ip.o \
+   pk/pkcs1/pkcs_1_pss_decode.o \
+   pk/pkcs1/pkcs_1_pss_encode.o \
+   pk/pkcs1/pkcs_1_v1_5_decode.o \
+   pk/pkcs1/pkcs_1_v1_5_encode.o \
+   pk/rsa/rsa_decrypt_key.o \
+   pk/rsa/rsa_encrypt_key.o \
+   pk/rsa/rsa_export.o \
+   pk/rsa/rsa_exptmod.o \
+   pk/rsa/rsa_free.o \
+   pk/rsa/rsa_get_size.o \
+   pk/rsa/rsa_import.o \
+   pk/rsa/rsa_import_pkcs8.o \
+   pk/rsa/rsa_import_x509.o \
+   pk/rsa/rsa_make_key.o \
+   pk/rsa/rsa_set.o \
+   pk/rsa/rsa_sign_hash.o \
+   pk/rsa/rsa_sign_saltlen_get.o \
+   pk/rsa/rsa_verify_hash.o \
+   prngs/chacha20.o \
+   prngs/fortuna.o \
+   prngs/rc4.o \
+   prngs/rng_get_bytes.o \
+   prngs/rng_make_prng.o \
+   prngs/sober128.o \
+   prngs/sprng.o \
+   prngs/yarrow.o \
+   stream/chacha/chacha_crypt.o \
+   stream/chacha/chacha_done.o \
+   stream/chacha/chacha_ivctr32.o \
+   stream/chacha/chacha_ivctr64.o \
+   stream/chacha/chacha_keystream.o \
+   stream/chacha/chacha_setup.o \
+   stream/chacha/chacha_test.o \
+   stream/rc4/rc4_stream.o \
+   stream/rc4/rc4_test.o \
+   stream/sober128/sober128_stream.o \
+   stream/sober128/sober128_test.o
+
+libtomcrypt/%.o: CFLAGS+=-DTFM_DESC -Isrc/headers -Itomsfastmath/src/headers -DARGTYPE=4 -DLTC_NO_ASM -DTFM_NO_ASM -Ilibtomcrypt/src/headers -DLTC_SOURCE
+
+ltc.o: $(addprefix libtomcrypt/src/, $(LTCOBJ))
        ld -o $@ -r $+
 
+zpm-fetchurl.o: CFLAGS+=-DTFM_DESC -Isrc/headers -Itomsfastmath/src/headers -DARGTYPE=4 -DLTC_NO_ASM -DTFM_NO_ASM -Ilibtomcrypt/src/headers -DLTC_SOURCE -Icrypto
+
+zpm-fetchurl: ltc.o tls.o tfm.o zpm-fetchurl.o crypto/https.o
+
+testddg: zpm-fetchurl
+       ./zpm-fetchurl duckduckgo.com 443 /
+
+testgra: zpm-fetchurl
+       ./zpm-fetchurl granicus.if.org 443 /
+
 clean:
        rm -f *.o sqlite/*.o lib/*.o $(LZMAOBJ) liblzma.a \
                libelf.a libzpm.a zpm-addfile soname \
@@ -236,4 +773,7 @@ clean:
                db.sql \
                elf/*.o lib/jsw/*.o \
                $(addprefix crypto/ref10/, $(X255OBJ)) \
+               $(addprefix crypto/, $(TLSOBJ)) \
+               $(addprefix tomsfastmath/src/, $(TFMOBJ)) \
+               $(addprefix libtomcrypt/src/, $(LTCOBJ)) \
                x25519.o