1b0104773SPascal Brandglobal-incdirs-y += include 25a913ee7SJerome Forissierglobal-incdirs-y += src/headers 35a913ee7SJerome Forissier 45e2cacd0SJens Wiklandercflags-lib-y += -Wno-declaration-after-statement 55e2cacd0SJens Wiklander 65a913ee7SJerome Forissiercppflags-lib-y += -DARGTYPE=4 # Make LTC_ARGCHK() return on error 75a913ee7SJerome Forissiercppflags-lib-y += -DLTC_CLEAN_STACK -DLTC_NO_TEST -DLTC_NO_PROTOTYPES 85a913ee7SJerome Forissiercppflags-lib-y += -DLTC_NO_TABLES -DLTC_HASH_HELPERS 95a913ee7SJerome Forissiercppflags-lib-$(_CFG_CORE_LTC_SIZE_OPTIMIZATION) += -DLTC_SMALL_CODE 105a913ee7SJerome Forissier 115a913ee7SJerome Forissiercppflags-lib-y += -DLTC_NO_CIPHERS 125a913ee7SJerome Forissier 134576dbb3SJens Wiklanderifeq ($(_CFG_CORE_LTC_AES_DESC),y) 145a913ee7SJerome Forissier cppflags-lib-y += -DLTC_RIJNDAEL 155a913ee7SJerome Forissierendif 165a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_DES),y) 175a913ee7SJerome Forissier cppflags-lib-y += -DLTC_DES 185a913ee7SJerome Forissierendif 195a913ee7SJerome Forissier 205a913ee7SJerome Forissiercppflags-lib-y += -DLTC_NO_MODES 215a913ee7SJerome Forissier 225a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_ECB),y) 235a913ee7SJerome Forissier cppflags-lib-y += -DLTC_ECB_MODE 245a913ee7SJerome Forissierendif 255a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_CBC),y) 265a913ee7SJerome Forissier cppflags-lib-y += -DLTC_CBC_MODE 275a913ee7SJerome Forissierendif 285a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_CTR),y) 295a913ee7SJerome Forissier cppflags-lib-y += -DLTC_CTR_MODE 305a913ee7SJerome Forissierendif 315a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_XTS),y) 325a913ee7SJerome Forissier cppflags-lib-y += -DLTC_XTS_MODE 335a913ee7SJerome Forissierendif 345a913ee7SJerome Forissier 355a913ee7SJerome Forissiercppflags-lib-y += -DLTC_NO_HASHES 365a913ee7SJerome Forissier 375a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_MD5),y) 385a913ee7SJerome Forissier cppflags-lib-y += -DLTC_MD5 395a913ee7SJerome Forissierendif 405a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_SHA1),y) 415a913ee7SJerome Forissier cppflags-lib-y += -DLTC_SHA1 425a913ee7SJerome Forissierendif 435a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_SHA224),y) 445a913ee7SJerome Forissier cppflags-lib-y += -DLTC_SHA224 455a913ee7SJerome Forissierendif 464576dbb3SJens Wiklanderifeq ($(_CFG_CORE_LTC_SHA256_DESC),y) 475a913ee7SJerome Forissier cppflags-lib-y += -DLTC_SHA256 485a913ee7SJerome Forissierendif 494576dbb3SJens Wiklanderifeq ($(_CFG_CORE_LTC_SHA384_DESC),y) 505a913ee7SJerome Forissier cppflags-lib-y += -DLTC_SHA384 515a913ee7SJerome Forissierendif 524576dbb3SJens Wiklanderifeq ($(_CFG_CORE_LTC_SHA512_DESC),y) 535a913ee7SJerome Forissier cppflags-lib-y += -DLTC_SHA512 545a913ee7SJerome Forissierendif 555a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_SHA512_256),y) 565a913ee7SJerome Forissier cppflags-lib-y += -DLTC_SHA512_256 575a913ee7SJerome Forissierendif 585a913ee7SJerome Forissier 595a913ee7SJerome Forissiercppflags-lib-y += -DLTC_NO_MACS 605a913ee7SJerome Forissier 615a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_HMAC),y) 625a913ee7SJerome Forissier cppflags-lib-y += -DLTC_HMAC 635a913ee7SJerome Forissierendif 645a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_CMAC),y) 655a913ee7SJerome Forissier cppflags-lib-y += -DLTC_OMAC 665a913ee7SJerome Forissierendif 675a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_CCM),y) 685a913ee7SJerome Forissier cppflags-lib-y += -DLTC_CCM_MODE 695a913ee7SJerome Forissierendif 705a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_GCM),y) 715a913ee7SJerome Forissier cppflags-lib-y += -DLTC_GCM_MODE 725a913ee7SJerome Forissierendif 735a913ee7SJerome Forissier 745a913ee7SJerome Forissiercppflags-lib-y += -DLTC_NO_PK 755a913ee7SJerome Forissier 765a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_RSA),y) 775a913ee7SJerome Forissier cppflags-lib-y += -DLTC_MRSA 785a913ee7SJerome Forissierendif 795a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_DSA),y) 805a913ee7SJerome Forissier cppflags-lib-y += -DLTC_MDSA 815a913ee7SJerome Forissierendif 825a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_DH),y) 835a913ee7SJerome Forissier cppflags-lib-y += -DLTC_MDH 845a913ee7SJerome Forissierendif 855a913ee7SJerome Forissierifeq ($(_CFG_CORE_LTC_ECC),y) 865a913ee7SJerome Forissier cppflags-lib-y += -DLTC_MECC 875a913ee7SJerome Forissier 885a913ee7SJerome Forissier # use Shamir's trick for point mul (speeds up signature verification) 895a913ee7SJerome Forissier cppflags-lib-y += -DLTC_ECC_SHAMIR 905a913ee7SJerome Forissier 915a913ee7SJerome Forissier cppflags-lib-y += -DLTC_ECC192 925a913ee7SJerome Forissier cppflags-lib-y += -DLTC_ECC224 935a913ee7SJerome Forissier cppflags-lib-y += -DLTC_ECC256 945a913ee7SJerome Forissier cppflags-lib-y += -DLTC_ECC384 955a913ee7SJerome Forissier cppflags-lib-y += -DLTC_ECC521 965a913ee7SJerome Forissier 975a913ee7SJerome Forissier # ECC 521 bits is the max supported key size 985a913ee7SJerome Forissier cppflags-lib-y += -DLTC_MAX_ECC=521 995a913ee7SJerome Forissierendif 10072d11d95SJerome Forissierifneq (,$(filter y,$(_CFG_CORE_LTC_SM2_DSA) $(_CFG_CORE_LTC_SM2_PKE))) 101f9a78287SJerome Forissier cppflags-lib-y += -DLTC_ECC_SM2 102f9a78287SJerome Forissierendif 1035a913ee7SJerome Forissier 104*15cb2782SSohaib ul Hassancppflags-lib-$(_CFG_CORE_LTC_X25519) += -DLTC_CURVE25519 105*15cb2782SSohaib ul Hassan 1065a913ee7SJerome Forissiercppflags-lib-y += -DLTC_NO_PKCS 1075a913ee7SJerome Forissier 1085a913ee7SJerome Forissiercppflags-lib-y += -DLTC_DER 1095a913ee7SJerome Forissier 1105a913ee7SJerome Forissiercppflags-lib-y += -DLTC_NO_PRNGS -DLTC_FORTUNA 1115a913ee7SJerome Forissier 1125a913ee7SJerome Forissiercflags-lib-$(_CFG_CORE_LTC_SIZE_OPTIMIZATION) += -Os 113b0104773SPascal Brand 114b0104773SPascal Brandsubdirs-y += src 1156648f482SJens Wiklander 116a1cbb728SJens Wiklandersrcs-$(_CFG_CORE_LTC_HASH) += hash.c 117a1cbb728SJens Wiklandersrcs-$(_CFG_CORE_LTC_HMAC) += hmac.c 118a1cbb728SJens Wiklandersrcs-$(_CFG_CORE_LTC_CMAC) += cmac.c 119a1cbb728SJens Wiklandersrcs-$(_CFG_CORE_LTC_ECB) += ecb.c 120a1cbb728SJens Wiklandersrcs-$(_CFG_CORE_LTC_CBC) += cbc.c 121a1cbb728SJens Wiklandersrcs-$(_CFG_CORE_LTC_CTR) += ctr.c 122a1cbb728SJens Wiklandersrcs-$(_CFG_CORE_LTC_XTS) += xts.c 123a1cbb728SJens Wiklandersrcs-$(_CFG_CORE_LTC_CCM) += ccm.c 124a1cbb728SJens Wiklandersrcs-$(_CFG_CORE_LTC_GCM) += gcm.c 125a1cbb728SJens Wiklandersrcs-$(_CFG_CORE_LTC_DSA) += dsa.c 126a1cbb728SJens Wiklandersrcs-$(_CFG_CORE_LTC_ECC) += ecc.c 127a1cbb728SJens Wiklandersrcs-$(_CFG_CORE_LTC_RSA) += rsa.c 128a1cbb728SJens Wiklandersrcs-$(_CFG_CORE_LTC_DH) += dh.c 129a1cbb728SJens Wiklandersrcs-$(_CFG_CORE_LTC_AES) += aes.c 130f9429266SJens Wiklandersrcs-$(_CFG_CORE_LTC_AES_ACCEL) += aes_accel.c 1312b49b295SJens Wiklandersrcs-$(_CFG_CORE_LTC_SHA1_ACCEL) += sha1_accel.c 132a828d70fSJens Wiklanderifeq ($(_CFG_CORE_LTC_SHA256_DESC),y) 133a828d70fSJens Wiklandersrcs-$(_CFG_CORE_LTC_SHA256_ACCEL) += sha256_accel.c 134a828d70fSJens Wiklanderendif 13576c7ba4bSJerome Forissiersrcs-$(_CFG_CORE_LTC_SM2_DSA) += sm2-dsa.c 136f9a78287SJerome Forissiersrcs-$(_CFG_CORE_LTC_SM2_PKE) += sm2-pke.c 137c2c877dbSJerome Forissiersrcs-$(_CFG_CORE_LTC_SM2_KEP) += sm2-kep.c 138*15cb2782SSohaib ul Hassansrcs-$(_CFG_CORE_LTC_X25519) += x25519.c 1399e8c816aSJerome Forissierifeq ($(_CFG_CORE_LTC_ACIPHER),y) 14078887e60SJens Wiklandersrcs-y += mpi_desc.c 14178887e60SJens Wiklanderendif 14278887e60SJens Wiklander 14378887e60SJens Wiklandersrcs-y += tomcrypt.c 14478887e60SJens Wiklander 145