10957b409SSimon J. Gerraty# This is a reach over build of BearSSL (www.BearSSL.org) 20957b409SSimon J. Gerraty 30957b409SSimon J. Gerraty.include <src.opts.mk> 40957b409SSimon J. Gerraty 50957b409SSimon J. GerratyLIB= bearssl 60957b409SSimon J. Gerraty 70957b409SSimon J. Gerraty# pick up SRCS used by libsa 80957b409SSimon J. Gerraty.include "Makefile.libsa.inc" 90957b409SSimon J. Gerraty 100957b409SSimon J. GerratySRCS+= \ 110957b409SSimon J. Gerraty codec/dec16be.c \ 120957b409SSimon J. Gerraty codec/dec16le.c \ 130957b409SSimon J. Gerraty codec/dec32le.c \ 140957b409SSimon J. Gerraty codec/dec64le.c \ 150957b409SSimon J. Gerraty codec/enc16be.c \ 160957b409SSimon J. Gerraty codec/enc16le.c \ 170957b409SSimon J. Gerraty codec/enc32le.c \ 180957b409SSimon J. Gerraty codec/enc64le.c \ 190957b409SSimon J. Gerraty codec/pemenc.c \ 200957b409SSimon J. Gerraty ec/ec_all_m15.c \ 210957b409SSimon J. Gerraty ec/ec_c25519_i15.c \ 220957b409SSimon J. Gerraty ec/ec_c25519_i31.c \ 230957b409SSimon J. Gerraty ec/ec_c25519_m15.c \ 240957b409SSimon J. Gerraty ec/ec_curve25519.c \ 250957b409SSimon J. Gerraty ec/ec_keygen.c \ 260957b409SSimon J. Gerraty ec/ec_p256_m15.c \ 270957b409SSimon J. Gerraty ec/ec_prime_i15.c \ 280957b409SSimon J. Gerraty ec/ecdsa_default_sign_asn1.c \ 290957b409SSimon J. Gerraty ec/ecdsa_default_sign_raw.c \ 300957b409SSimon J. Gerraty ec/ecdsa_default_vrfy_raw.c \ 310957b409SSimon J. Gerraty ec/ecdsa_i15_bits.c \ 320957b409SSimon J. Gerraty ec/ecdsa_i15_sign_asn1.c \ 330957b409SSimon J. Gerraty ec/ecdsa_i15_sign_raw.c \ 340957b409SSimon J. Gerraty ec/ecdsa_i15_vrfy_asn1.c \ 350957b409SSimon J. Gerraty ec/ecdsa_i15_vrfy_raw.c \ 360957b409SSimon J. Gerraty ec/ecdsa_i31_sign_asn1.c \ 370957b409SSimon J. Gerraty ec/ecdsa_i31_sign_raw.c \ 380957b409SSimon J. Gerraty ec/ecdsa_rta.c \ 390957b409SSimon J. Gerraty hash/dig_oid.c \ 400957b409SSimon J. Gerraty hash/dig_size.c \ 410957b409SSimon J. Gerraty hash/ghash_ctmul.c \ 420957b409SSimon J. Gerraty hash/ghash_ctmul32.c \ 430957b409SSimon J. Gerraty hash/ghash_ctmul64.c \ 440957b409SSimon J. Gerraty hash/ghash_pwr8.c \ 450957b409SSimon J. Gerraty hash/md5.c \ 460957b409SSimon J. Gerraty hash/md5sha1.c \ 47*1edb7116SWarner Losh hash/mgf1.c 480957b409SSimon J. Gerraty 490957b409SSimon J. Gerraty 500957b409SSimon J. Gerraty# this one does not compile for amd64 510957b409SSimon J. Gerraty# we do not need it 520957b409SSimon J. Gerraty# hash/ghash_pclmul.c \ 530957b409SSimon J. Gerraty 540957b409SSimon J. GerratySRCS+= \ 550957b409SSimon J. Gerraty int/i15_add.c \ 560957b409SSimon J. Gerraty int/i15_bitlen.c \ 570957b409SSimon J. Gerraty int/i15_decmod.c \ 580957b409SSimon J. Gerraty int/i15_decode.c \ 590957b409SSimon J. Gerraty int/i15_decred.c \ 600957b409SSimon J. Gerraty int/i15_encode.c \ 610957b409SSimon J. Gerraty int/i15_fmont.c \ 620957b409SSimon J. Gerraty int/i15_iszero.c \ 630957b409SSimon J. Gerraty int/i15_moddiv.c \ 640957b409SSimon J. Gerraty int/i15_modpow.c \ 650957b409SSimon J. Gerraty int/i15_modpow2.c \ 660957b409SSimon J. Gerraty int/i15_montmul.c \ 670957b409SSimon J. Gerraty int/i15_mulacc.c \ 680957b409SSimon J. Gerraty int/i15_muladd.c \ 690957b409SSimon J. Gerraty int/i15_ninv15.c \ 700957b409SSimon J. Gerraty int/i15_reduce.c \ 710957b409SSimon J. Gerraty int/i15_rshift.c \ 720957b409SSimon J. Gerraty int/i15_sub.c \ 730957b409SSimon J. Gerraty int/i15_tmont.c \ 740957b409SSimon J. Gerraty int/i31_decred.c \ 750957b409SSimon J. Gerraty int/i31_mulacc.c \ 760957b409SSimon J. Gerraty int/i31_reduce.c \ 770957b409SSimon J. Gerraty int/i32_add.c \ 780957b409SSimon J. Gerraty int/i32_bitlen.c \ 790957b409SSimon J. Gerraty int/i32_decmod.c \ 800957b409SSimon J. Gerraty int/i32_decode.c \ 810957b409SSimon J. Gerraty int/i32_decred.c \ 820957b409SSimon J. Gerraty int/i32_encode.c \ 830957b409SSimon J. Gerraty int/i32_fmont.c \ 840957b409SSimon J. Gerraty int/i32_iszero.c \ 850957b409SSimon J. Gerraty int/i32_modpow.c \ 860957b409SSimon J. Gerraty int/i32_montmul.c \ 870957b409SSimon J. Gerraty int/i32_mulacc.c \ 880957b409SSimon J. Gerraty int/i32_muladd.c \ 890957b409SSimon J. Gerraty int/i32_ninv32.c \ 900957b409SSimon J. Gerraty int/i32_reduce.c \ 910957b409SSimon J. Gerraty int/i32_sub.c \ 920957b409SSimon J. Gerraty int/i32_tmont.c \ 930957b409SSimon J. Gerraty 940957b409SSimon J. GerratySRCS+= \ 950957b409SSimon J. Gerraty kdf/hkdf.c \ 960957b409SSimon J. Gerraty kdf/shake.c \ 970957b409SSimon J. Gerraty 980957b409SSimon J. GerratySRCS+= \ 990957b409SSimon J. Gerraty rsa/rsa_default_keygen.c \ 1000957b409SSimon J. Gerraty rsa/rsa_default_modulus.c \ 1010957b409SSimon J. Gerraty rsa/rsa_default_pkcs1_sign.c \ 1020957b409SSimon J. Gerraty rsa/rsa_default_priv.c \ 1030957b409SSimon J. Gerraty rsa/rsa_default_privexp.c \ 1040957b409SSimon J. Gerraty rsa/rsa_default_pss_sign.c \ 1050957b409SSimon J. Gerraty rsa/rsa_default_pss_vrfy.c \ 1060957b409SSimon J. Gerraty rsa/rsa_default_pub.c \ 1070957b409SSimon J. Gerraty rsa/rsa_default_pubexp.c \ 1080957b409SSimon J. Gerraty rsa/rsa_i15_keygen.c \ 1090957b409SSimon J. Gerraty rsa/rsa_i15_modulus.c \ 1100957b409SSimon J. Gerraty rsa/rsa_i15_pkcs1_sign.c \ 1110957b409SSimon J. Gerraty rsa/rsa_i15_pkcs1_vrfy.c \ 1120957b409SSimon J. Gerraty rsa/rsa_i15_priv.c \ 1130957b409SSimon J. Gerraty rsa/rsa_i15_privexp.c \ 1140957b409SSimon J. Gerraty rsa/rsa_i15_pss_sign.c \ 1150957b409SSimon J. Gerraty rsa/rsa_i15_pss_vrfy.c \ 1160957b409SSimon J. Gerraty rsa/rsa_i15_pub.c \ 1170957b409SSimon J. Gerraty rsa/rsa_i15_pubexp.c \ 1180957b409SSimon J. Gerraty rsa/rsa_i31_keygen.c \ 1190957b409SSimon J. Gerraty rsa/rsa_i31_keygen_inner.c \ 1200957b409SSimon J. Gerraty rsa/rsa_i31_modulus.c \ 1210957b409SSimon J. Gerraty rsa/rsa_i31_pkcs1_sign.c \ 1220957b409SSimon J. Gerraty rsa/rsa_i31_priv.c \ 1230957b409SSimon J. Gerraty rsa/rsa_i31_privexp.c \ 1240957b409SSimon J. Gerraty rsa/rsa_i31_pss_sign.c \ 1250957b409SSimon J. Gerraty rsa/rsa_i31_pss_vrfy.c \ 1260957b409SSimon J. Gerraty rsa/rsa_i31_pubexp.c \ 1270957b409SSimon J. Gerraty rsa/rsa_i32_pkcs1_sign.c \ 1280957b409SSimon J. Gerraty rsa/rsa_i32_pkcs1_vrfy.c \ 1290957b409SSimon J. Gerraty rsa/rsa_i32_priv.c \ 1300957b409SSimon J. Gerraty rsa/rsa_i32_pss_sign.c \ 1310957b409SSimon J. Gerraty rsa/rsa_i32_pss_vrfy.c \ 1320957b409SSimon J. Gerraty rsa/rsa_i32_pub.c \ 1330957b409SSimon J. Gerraty rsa/rsa_i62_keygen.c \ 1340957b409SSimon J. Gerraty rsa/rsa_i62_pkcs1_sign.c \ 1350957b409SSimon J. Gerraty rsa/rsa_i62_priv.c \ 1360957b409SSimon J. Gerraty rsa/rsa_i62_pss_sign.c \ 1370957b409SSimon J. Gerraty rsa/rsa_i62_pss_vrfy.c \ 1380957b409SSimon J. Gerraty rsa/rsa_pkcs1_sig_pad.c \ 1390957b409SSimon J. Gerraty rsa/rsa_pss_sig_pad.c \ 1400957b409SSimon J. Gerraty rsa/rsa_pss_sig_unpad.c \ 1410957b409SSimon J. Gerraty rsa/rsa_ssl_decrypt.c \ 1420957b409SSimon J. Gerraty 1430957b409SSimon J. GerratySRCS+= \ 1440957b409SSimon J. Gerraty x509/encode_ec_pk8der.c \ 1450957b409SSimon J. Gerraty x509/encode_ec_rawder.c \ 1460957b409SSimon J. Gerraty x509/encode_rsa_pk8der.c \ 1470957b409SSimon J. Gerraty x509/encode_rsa_rawder.c \ 1480957b409SSimon J. Gerraty x509/skey_decoder.c \ 1490957b409SSimon J. Gerraty x509/x509_knownkey.c \ 1500957b409SSimon J. Gerraty x509/x509_minimal_full.c \ 1510957b409SSimon J. Gerraty 152*1edb7116SWarner LoshSRCS+= \ 153*1edb7116SWarner Losh rand/hmac_drbg.c \ 154*1edb7116SWarner Losh mac/hmac.c \ 155*1edb7116SWarner Losh mac/hmac_ct.c \ 156*1edb7116SWarner Losh 1570957b409SSimon J. GerratyINCS= \ 1580957b409SSimon J. Gerraty inc/bearssl.h \ 1590957b409SSimon J. Gerraty inc/bearssl_aead.h \ 1600957b409SSimon J. Gerraty inc/bearssl_block.h \ 1610957b409SSimon J. Gerraty inc/bearssl_ec.h \ 1620957b409SSimon J. Gerraty inc/bearssl_hash.h \ 1630957b409SSimon J. Gerraty inc/bearssl_hmac.h \ 1640957b409SSimon J. Gerraty inc/bearssl_kdf.h \ 1650957b409SSimon J. Gerraty inc/bearssl_pem.h \ 1660957b409SSimon J. Gerraty inc/bearssl_prf.h \ 1670957b409SSimon J. Gerraty inc/bearssl_rand.h \ 1680957b409SSimon J. Gerraty inc/bearssl_rsa.h \ 1690957b409SSimon J. Gerraty inc/bearssl_ssl.h \ 1700957b409SSimon J. Gerraty inc/bearssl_x509.h \ 1710957b409SSimon J. Gerraty 1720957b409SSimon J. GerratyINCS:= ${INCS:S,^,${BEARSSL}/,} 1730957b409SSimon J. Gerraty 1740957b409SSimon J. Gerraty 1750957b409SSimon J. Gerraty.if ${MK_BEARSSL_SSL:Uno} == "yes" 1760957b409SSimon J. GerratySRCS+= \ 1770957b409SSimon J. Gerraty ssl/prf.c \ 1780957b409SSimon J. Gerraty ssl/prf_md5sha1.c \ 1790957b409SSimon J. Gerraty ssl/prf_sha256.c \ 1800957b409SSimon J. Gerraty ssl/prf_sha384.c \ 1810957b409SSimon J. Gerraty ssl/ssl_ccert_single_ec.c \ 1820957b409SSimon J. Gerraty ssl/ssl_ccert_single_rsa.c \ 1830957b409SSimon J. Gerraty ssl/ssl_client.c \ 1840957b409SSimon J. Gerraty ssl/ssl_client_default_rsapub.c \ 1850957b409SSimon J. Gerraty ssl/ssl_client_full.c \ 1860957b409SSimon J. Gerraty ssl/ssl_engine.c \ 1870957b409SSimon J. Gerraty ssl/ssl_engine_default_aescbc.c \ 1880957b409SSimon J. Gerraty ssl/ssl_engine_default_aesccm.c \ 1890957b409SSimon J. Gerraty ssl/ssl_engine_default_aesgcm.c \ 1900957b409SSimon J. Gerraty ssl/ssl_engine_default_chapol.c \ 1910957b409SSimon J. Gerraty ssl/ssl_engine_default_descbc.c \ 1920957b409SSimon J. Gerraty ssl/ssl_engine_default_ec.c \ 1930957b409SSimon J. Gerraty ssl/ssl_engine_default_ecdsa.c \ 1940957b409SSimon J. Gerraty ssl/ssl_engine_default_rsavrfy.c \ 1950957b409SSimon J. Gerraty ssl/ssl_hashes.c \ 1960957b409SSimon J. Gerraty ssl/ssl_hs_client.c \ 1970957b409SSimon J. Gerraty ssl/ssl_hs_server.c \ 1980957b409SSimon J. Gerraty ssl/ssl_io.c \ 1990957b409SSimon J. Gerraty ssl/ssl_lru.c \ 2000957b409SSimon J. Gerraty ssl/ssl_rec_cbc.c \ 2010957b409SSimon J. Gerraty ssl/ssl_rec_ccm.c \ 2020957b409SSimon J. Gerraty ssl/ssl_rec_chapol.c \ 2030957b409SSimon J. Gerraty ssl/ssl_rec_gcm.c \ 2040957b409SSimon J. Gerraty ssl/ssl_scert_single_ec.c \ 2050957b409SSimon J. Gerraty ssl/ssl_scert_single_rsa.c \ 2060957b409SSimon J. Gerraty ssl/ssl_server.c \ 2070957b409SSimon J. Gerraty ssl/ssl_server_full_ec.c \ 2080957b409SSimon J. Gerraty ssl/ssl_server_full_rsa.c \ 2090957b409SSimon J. Gerraty ssl/ssl_server_mine2c.c \ 2100957b409SSimon J. Gerraty ssl/ssl_server_mine2g.c \ 2110957b409SSimon J. Gerraty ssl/ssl_server_minf2c.c \ 2120957b409SSimon J. Gerraty ssl/ssl_server_minf2g.c \ 2130957b409SSimon J. Gerraty ssl/ssl_server_minr2g.c \ 2140957b409SSimon J. Gerraty ssl/ssl_server_minu2g.c \ 2150957b409SSimon J. Gerraty ssl/ssl_server_minv2g.c \ 2160957b409SSimon J. Gerraty 2170957b409SSimon J. GerratySRCS+= \ 2180957b409SSimon J. Gerraty symcipher/aes_big_cbcdec.c \ 2190957b409SSimon J. Gerraty symcipher/aes_big_cbcenc.c \ 2200957b409SSimon J. Gerraty symcipher/aes_big_ctr.c \ 2210957b409SSimon J. Gerraty symcipher/aes_big_dec.c \ 2220957b409SSimon J. Gerraty symcipher/aes_big_enc.c \ 2230957b409SSimon J. Gerraty symcipher/aes_common.c \ 2240957b409SSimon J. Gerraty symcipher/aes_ct.c \ 2250957b409SSimon J. Gerraty symcipher/aes_ct64.c \ 2260957b409SSimon J. Gerraty symcipher/aes_ct64_cbcdec.c \ 2270957b409SSimon J. Gerraty symcipher/aes_ct64_cbcenc.c \ 2280957b409SSimon J. Gerraty symcipher/aes_ct64_ctr.c \ 2290957b409SSimon J. Gerraty symcipher/aes_ct64_dec.c \ 2300957b409SSimon J. Gerraty symcipher/aes_ct64_enc.c \ 2310957b409SSimon J. Gerraty symcipher/aes_ct_cbcdec.c \ 2320957b409SSimon J. Gerraty symcipher/aes_ct_cbcenc.c \ 2330957b409SSimon J. Gerraty symcipher/aes_ct_ctr.c \ 2340957b409SSimon J. Gerraty symcipher/aes_ct_dec.c \ 2350957b409SSimon J. Gerraty symcipher/aes_ct_enc.c \ 2360957b409SSimon J. Gerraty symcipher/aes_pwr8.c \ 2370957b409SSimon J. Gerraty symcipher/aes_pwr8_cbcdec.c \ 2380957b409SSimon J. Gerraty symcipher/aes_pwr8_cbcenc.c \ 2390957b409SSimon J. Gerraty symcipher/aes_pwr8_ctr.c \ 2400957b409SSimon J. Gerraty symcipher/aes_pwr8_ctrcbc.c \ 2410957b409SSimon J. Gerraty symcipher/aes_small_cbcdec.c \ 2420957b409SSimon J. Gerraty symcipher/aes_small_cbcenc.c \ 2430957b409SSimon J. Gerraty symcipher/aes_small_ctr.c \ 2440957b409SSimon J. Gerraty symcipher/aes_small_dec.c \ 2450957b409SSimon J. Gerraty symcipher/aes_small_enc.c \ 2460957b409SSimon J. Gerraty symcipher/aes_x86ni.c \ 2470957b409SSimon J. Gerraty symcipher/aes_x86ni_cbcdec.c \ 2480957b409SSimon J. Gerraty symcipher/aes_x86ni_cbcenc.c \ 2490957b409SSimon J. Gerraty symcipher/aes_x86ni_ctr.c \ 2500957b409SSimon J. Gerraty symcipher/chacha20_ct.c \ 2510957b409SSimon J. Gerraty symcipher/des_ct.c \ 2520957b409SSimon J. Gerraty symcipher/des_ct_cbcdec.c \ 2530957b409SSimon J. Gerraty symcipher/des_ct_cbcenc.c \ 2540957b409SSimon J. Gerraty symcipher/des_support.c \ 2550957b409SSimon J. Gerraty symcipher/des_tab.c \ 2560957b409SSimon J. Gerraty symcipher/des_tab_cbcdec.c \ 2570957b409SSimon J. Gerraty symcipher/des_tab_cbcenc.c \ 2580957b409SSimon J. Gerraty symcipher/poly1305_ctmul.c \ 2590957b409SSimon J. Gerraty symcipher/poly1305_ctmul32.c \ 2600957b409SSimon J. Gerraty symcipher/poly1305_ctmulq.c \ 2610957b409SSimon J. Gerraty symcipher/poly1305_i15.c \ 2620957b409SSimon J. Gerraty 2630957b409SSimon J. Gerraty.endif 2640957b409SSimon J. Gerraty 2650957b409SSimon J. Gerraty.include <bsd.lib.mk> 2660957b409SSimon J. Gerraty 2670957b409SSimon J. Gerraty.if ${MACHINE} == "host" 2680957b409SSimon J. GerratyCWARNFLAGS+= -Wno-error 2690957b409SSimon J. Gerraty.endif 2700957b409SSimon J. GerratyXCFLAGS.gcc.rsa_i62_keygen+= -Wno-error 2710957b409SSimon J. GerratyXCFLAGS.i15_moddiv+= -Wno-shadow 2720957b409SSimon J. GerratyXCFLAGS.i31_moddiv+= -Wno-shadow 2730957b409SSimon J. GerratyXCFLAGS.i62_modpow2+= -Wno-cast-align 2740957b409SSimon J. GerratyXCFLAGS.x509_minimal+= -Wno-cast-qual 2750957b409SSimon J. Gerraty 2760957b409SSimon J. GerratyCFLAGS+= ${XCFLAGS.${.TARGET:T:R}:U} \ 2770957b409SSimon J. Gerraty ${XCFLAGS.${COMPILER_TYPE}.${.TARGET:T:R}:U} 2780957b409SSimon J. Gerraty 279