1global-incdirs-y += include
2global-incdirs-y += src/headers
3
4cflags-lib-y += -Wno-declaration-after-statement
5
6cppflags-lib-y += -DARGTYPE=4  # Make LTC_ARGCHK() return on error
7cppflags-lib-y += -DLTC_NO_TEST -DLTC_NO_PROTOTYPES
8cppflags-lib-y += -DLTC_NO_TABLES -DLTC_HASH_HELPERS
9cppflags-lib-y += -DLTC_NO_MISC
10cppflags-lib-y += -DLTC_HMAC
11cppflags-lib-$(_CFG_CORE_LTC_SIZE_OPTIMIZATION) += -DLTC_SMALL_CODE
12
13cppflags-lib-y += -DLTC_NO_CIPHERS
14
15ifeq ($(_CFG_CORE_LTC_AES_DESC),y)
16	cppflags-lib-y += -DLTC_RIJNDAEL
17endif
18ifeq ($(_CFG_CORE_LTC_DES),y)
19	cppflags-lib-y += -DLTC_DES
20endif
21
22cppflags-lib-y += -DLTC_NO_MODES
23
24ifeq ($(_CFG_CORE_LTC_ECB),y)
25	cppflags-lib-y += -DLTC_ECB_MODE
26endif
27ifeq ($(_CFG_CORE_LTC_CBC),y)
28	cppflags-lib-y += -DLTC_CBC_MODE
29endif
30ifeq ($(_CFG_CORE_LTC_CTR),y)
31	cppflags-lib-y += -DLTC_CTR_MODE
32endif
33ifeq ($(_CFG_CORE_LTC_XTS),y)
34	cppflags-lib-y += -DLTC_XTS_MODE
35endif
36
37cppflags-lib-y += -DLTC_NO_HASHES
38
39ifeq ($(_CFG_CORE_LTC_MD5),y)
40	cppflags-lib-y += -DLTC_MD5
41endif
42ifeq ($(_CFG_CORE_LTC_SHA1),y)
43	cppflags-lib-y += -DLTC_SHA1
44endif
45ifeq ($(_CFG_CORE_LTC_SHA224),y)
46	cppflags-lib-y += -DLTC_SHA224
47endif
48ifeq ($(_CFG_CORE_LTC_SHA256_DESC),y)
49	cppflags-lib-y += -DLTC_SHA256
50endif
51ifeq ($(_CFG_CORE_LTC_SHA384_DESC),y)
52	cppflags-lib-y += -DLTC_SHA384
53endif
54ifeq ($(_CFG_CORE_LTC_SHA512_DESC),y)
55	cppflags-lib-y += -DLTC_SHA512
56endif
57ifeq ($(_CFG_CORE_LTC_SHA512_256),y)
58	cppflags-lib-y += -DLTC_SHA512_256
59endif
60
61cppflags-lib-y += -DLTC_NO_MACS
62
63ifeq ($(_CFG_CORE_LTC_HMAC),y)
64	cppflags-lib-y += -DLTC_HMAC
65endif
66ifeq ($(_CFG_CORE_LTC_CMAC),y)
67	cppflags-lib-y += -DLTC_OMAC
68endif
69ifeq ($(_CFG_CORE_LTC_CCM),y)
70	cppflags-lib-y += -DLTC_CCM_MODE
71endif
72ifeq ($(_CFG_CORE_LTC_GCM),y)
73	cppflags-lib-y += -DLTC_GCM_MODE
74endif
75
76cppflags-lib-y += -DLTC_NO_PK
77
78ifeq ($(_CFG_CORE_LTC_RSA),y)
79   cppflags-lib-y += -DLTC_MRSA
80endif
81ifeq ($(_CFG_CORE_LTC_DSA),y)
82   cppflags-lib-y += -DLTC_MDSA
83endif
84ifeq ($(_CFG_CORE_LTC_DH),y)
85   cppflags-lib-y += -DLTC_MDH
86endif
87ifeq ($(_CFG_CORE_LTC_ECC),y)
88   cppflags-lib-y += -DLTC_MECC
89
90   # use Shamir's trick for point mul (speeds up signature verification)
91   cppflags-lib-y += -DLTC_ECC_SHAMIR
92
93   cppflags-lib-y += -DLTC_ECC192
94   cppflags-lib-y += -DLTC_ECC224
95   cppflags-lib-y += -DLTC_ECC256
96   cppflags-lib-y += -DLTC_ECC384
97   cppflags-lib-y += -DLTC_ECC521
98   cppflags-lib-y += -DLTC_CURVE25519
99
100   # ECC 521 bits is the max supported key size
101   cppflags-lib-y += -DLTC_MAX_ECC=521
102endif
103ifneq (,$(filter y,$(_CFG_CORE_LTC_SM2_DSA) $(_CFG_CORE_LTC_SM2_PKE)))
104   cppflags-lib-y += -DLTC_ECC_SM2
105endif
106
107cppflags-lib-$(_CFG_CORE_LTC_X25519) += -DLTC_CURVE25519
108cppflags-lib-$(_CFG_CORE_LTC_ED25519) += -DLTC_CURVE25519
109
110cppflags-lib-y += -DLTC_NO_PRNGS -DLTC_FORTUNA
111
112cflags-lib-$(_CFG_CORE_LTC_SIZE_OPTIMIZATION) += -Os
113
114subdirs-y += src
115
116srcs-$(_CFG_CORE_LTC_HASH) += hash.c
117srcs-$(_CFG_CORE_LTC_HMAC) += hmac.c
118srcs-$(_CFG_CORE_LTC_CMAC) += cmac.c
119srcs-$(_CFG_CORE_LTC_ECB) += ecb.c
120srcs-$(_CFG_CORE_LTC_CBC) += cbc.c
121srcs-$(_CFG_CORE_LTC_CTR) += ctr.c
122srcs-$(_CFG_CORE_LTC_XTS) += xts.c
123srcs-$(_CFG_CORE_LTC_CCM) += ccm.c
124srcs-$(_CFG_CORE_LTC_GCM) += gcm.c
125srcs-$(_CFG_CORE_LTC_DSA) += dsa.c
126srcs-$(_CFG_CORE_LTC_ECC) += ecc.c
127srcs-$(_CFG_CORE_LTC_RSA) += rsa.c
128srcs-$(_CFG_CORE_LTC_DH) += dh.c
129srcs-$(_CFG_CORE_LTC_AES) += aes.c
130srcs-$(_CFG_CORE_LTC_AES_ACCEL) += aes_accel.c
131srcs-$(_CFG_CORE_LTC_SHA1_ACCEL) += sha1_accel.c
132ifeq ($(_CFG_CORE_LTC_SHA256_DESC),y)
133srcs-$(_CFG_CORE_LTC_SHA256_ACCEL) += sha256_accel.c
134endif
135ifeq ($(_CFG_CORE_LTC_SHA512_DESC),y)
136srcs-$(_CFG_CORE_LTC_SHA512_ACCEL) += sha512_accel.c
137endif
138srcs-$(_CFG_CORE_LTC_SM2_DSA) += sm2-dsa.c
139srcs-$(_CFG_CORE_LTC_SM2_PKE) += sm2-pke.c
140srcs-$(_CFG_CORE_LTC_SM2_KEP) += sm2-kep.c
141srcs-$(_CFG_CORE_LTC_X25519) += x25519.c
142srcs-$(_CFG_CORE_LTC_ED25519) += ed25519.c
143ifeq ($(_CFG_CORE_LTC_ACIPHER),y)
144srcs-y += mpi_desc.c
145endif
146
147srcs-y += tomcrypt.c
148
149