xref: /freebsd/secure/lib/libpkgecc/Makefile (revision b2d2a78ad80ec68d4a17f5aef97d21686cb1e29b)
1
2# STOP - This is not a general purpose library and is only for use by pkg(7)
3# to align with the implementation in pkg(8).
4LIB=	pkgecc
5INTERNALLIB=
6
7.PATH: $(SRCTOP)/crypto/libecc
8SRCS+=	pkg_libecc_rand.c
9
10# curves_mod_src
11.PATH:	$(SRCTOP)/crypto/libecc/src/curves
12SRCS+=	aff_pt.c \
13	aff_pt_montgomery.c \
14	ec_edwards.c \
15	ec_montgomery.c \
16	ec_params.c \
17	ec_shortw.c \
18	aff_pt_edwards.c \
19	curves.c \
20	prj_pt.c
21
22# utils_ec_src
23.PATH:	$(SRCTOP)/crypto/libecc/src/utils
24SRCS+=	print_curves.c
25
26# fp_mod_src
27.PATH:	$(SRCTOP)/crypto/libecc/src/fp
28SRCS+=	fp_add.c \
29	fp.c \
30	fp_montgomery.c \
31	fp_mul.c \
32	fp_mul_redc1.c \
33	fp_pow.c \
34	fp_rand.c \
35	fp_sqrt.c
36
37# nn_mod_src
38.PATH:	$(SRCTOP)/crypto/libecc/src/nn
39SRCS+=	nn_add.c \
40	nn.c \
41	nn_div.c \
42	nn_logical.c \
43	nn_modinv.c \
44	nn_mod_pow.c \
45	nn_mul.c \
46	nn_mul_redc1.c \
47	nn_rand.c
48
49# utils_arith_src
50SRCS+=	utils.c \
51	utils_rand.c \
52	print_buf.c \
53	print_fp.c \
54	print_nn.c
55
56## libsign bits
57# hash_mod_src
58.PATH:	$(SRCTOP)/crypto/libecc/src/hash
59SRCS+=	hash_algs.c \
60	sm3.c \
61	streebog.c \
62	ripemd160.c \
63	belt-hash.c \
64	hmac.c \
65	bash224.c \
66	bash256.c \
67	bash384.c \
68	bash512.c \
69	bash.c \
70	sha224.c \
71	sha256.c \
72	sha3-224.c \
73	sha3-256.c \
74	sha3-384.c \
75	sha3-512.c \
76	sha384.c \
77	sha3.c \
78	sha512-224.c \
79	sha512-256.c \
80	sha512.c \
81	sha512_core.c \
82	shake256.c \
83	shake.c
84
85# sig_mod_src
86.PATH:	$(SRCTOP)/crypto/libecc/src/sig
87SRCS+=	decdsa.c \
88	ecdsa.c \
89	ecfsdsa.c \
90	ecgdsa.c \
91	eckcdsa.c \
92	ecosdsa.c \
93	ecrdsa.c \
94	ecsdsa.c \
95	eddsa.c \
96	fuzzing_ecdsa.c \
97	fuzzing_ecgdsa.c \
98	fuzzing_ecrdsa.c \
99	ecdsa_common.c \
100	ecsdsa_common.c \
101	sig_algs.c \
102	sm2.c \
103	bign_common.c \
104	bign.c \
105	dbign.c \
106	bip0340.c
107
108# key_mod_src
109SRCS+=	ec_key.c
110
111# utils_sign_src
112.PATH:	$(SRCTOP)/crypto/libecc/src/sig
113SRCS+=	print_keys.c
114
115# ecdh_mod_src
116.PATH:	$(SRCTOP)/crypto/libecc/src/ecdh
117SRCS+=	ecccdh.c \
118	x25519_448.c
119
120# external_deps
121.PATH:	$(SRCTOP)/crypto/libecc/src/external_deps
122SRCS+=	print.c
123
124CONFLICTS=	-Dsha256_init=_libecc_sha256_init \
125		-Dsha256_update=_libecc_sha256_update \
126		-Dsha256_final=_libecc_sha256_final \
127		-Dsha512_224_init=_libecc_sha512_224_init \
128		-Dsha512_256_init=_libecc_sha512_256_init
129
130CFLAGS=		-I$(SRCTOP)/crypto/libecc/include \
131		-ffreestanding \
132		-fno-builtin \
133		-DUSE_WARN_UNUSED_RET \
134		-DWITH_STDLIB \
135		$(CONFLICTS)
136
137.include <bsd.lib.mk>
138