xref: /netbsd-src/sys/rump/kern/lib/libcrypto/Makefile (revision 588821d8ae5af605ea1973e7aa89bb0a15cff666)
1#	$NetBSD: Makefile,v 1.18 2020/08/21 06:30:46 riastradh Exp $
2#
3
4SODIUM_IMPORTDIR=${.CURDIR}/../../../../external/isc/libsodium
5SODIUM_DIR=${.CURDIR}/../../../../external/isc/libsodium/dist/src/libsodium
6
7.PATH:	${.CURDIR}/../../../../crypto/adiantum				\
8	${.CURDIR}/../../../../crypto/aes				\
9	${.CURDIR}/../../../../crypto/blake2				\
10	${.CURDIR}/../../../../crypto/blowfish				\
11	${.CURDIR}/../../../../crypto/camellia				\
12	${.CURDIR}/../../../../crypto/cast128				\
13	${.CURDIR}/../../../../crypto/des				\
14	${.CURDIR}/../../../../crypto/skipjack				\
15	${SODIUM_DIR}/crypto_scalarmult/curve25519/ref10		\
16	${SODIUM_DIR}/crypto_scalarmult/curve25519			\
17	${SODIUM_DIR}/crypto_scalarmult					\
18	${SODIUM_DIR}/crypto_onetimeauth/poly1305/donna			\
19	${SODIUM_DIR}/crypto_onetimeauth/poly1305			\
20	${SODIUM_DIR}/crypto_onetimeauth				\
21	${SODIUM_DIR}/crypto_stream/chacha20/ref			\
22	${SODIUM_DIR}/crypto_stream/chacha20				\
23	${SODIUM_DIR}/crypto_aead/xchacha20poly1305/sodium		\
24	${SODIUM_DIR}/crypto_aead/chacha20poly1305/sodium		\
25	${SODIUM_DIR}/crypto_core/hchacha20				\
26	${SODIUM_DIR}/crypto_core/ed25519/ref10
27
28LIB=	rumpkern_crypto
29COMMENT=Cryptographic routines
30
31# Adiantum
32SRCS+=	adiantum.c
33SRCS+=	adiantum_selftest.c
34
35# AES
36SRCS+=	aes_bear.c
37SRCS+=	aes_ccm.c
38SRCS+=	aes_ccm_mbuf.c
39SRCS+=	aes_ct.c
40SRCS+=	aes_ct_dec.c
41SRCS+=	aes_ct_enc.c
42SRCS+=	aes_impl.c
43SRCS+=	aes_selftest.c
44
45# blowfish
46SRCS+=	bf_ecb.c bf_enc.c bf_cbc.c bf_skey.c bf_module.c
47
48# camellia
49SRCS+=  camellia.c camellia-api.c
50
51# cast128
52SRCS+=	cast128.c
53
54# DES
55SRCS+=	des_ecb.c des_setkey.c des_enc.c des_cbc.c des_module.c
56
57# skipjack
58SRCS+=	skipjack.c
59
60# BLAKE2
61SRCS+=	blake2s.c
62
63# Various cryptography functions
64SODIUM_CPPFLAGS=
65SODIUM_CPPFLAGS+=	-I${SODIUM_IMPORTDIR}/include
66SODIUM_CPPFLAGS+=	-I${SODIUM_IMPORTDIR}/dist/src/libsodium/include/sodium
67
68SODIUM_CPPFLAGS+=	-DHAVE_TI_MODE
69
70SODIUM_CPPFLAGS+=	-Wno-shadow
71SODIUM_CPPFLAGS+=	-Wno-unused-function
72SODIUM_CPPFLAGS+=	-Wno-unused-variable
73
74CPPFLAGS.x25519_ref10.c+=		${SODIUM_CPPFLAGS}
75CPPFLAGS.scalarmult_curve25519.c+=	${SODIUM_CPPFLAGS}
76CPPFLAGS.crypto_scalarmult.c+=		${SODIUM_CPPFLAGS}
77CPPFLAGS.poly1305_donna.c+=		${SODIUM_CPPFLAGS}
78CPPFLAGS.onetimeauth_poly1305.c+=	${SODIUM_CPPFLAGS}
79CPPFLAGS.crypto_onetimeauth.c+=		${SODIUM_CPPFLAGS}
80CPPFLAGS.chacha20_ref.c+=		${SODIUM_CPPFLAGS}
81CPPFLAGS.stream_chacha20.c+=		${SODIUM_CPPFLAGS}
82CPPFLAGS.aead_xchacha20poly1305.c+=	${SODIUM_CPPFLAGS}
83CPPFLAGS.aead_chacha20poly1305.c+=	${SODIUM_CPPFLAGS}
84CPPFLAGS.core_hchacha20.c+=		${SODIUM_CPPFLAGS}
85CPPFLAGS.ed25519_ref10.c+=		${SODIUM_CPPFLAGS}
86
87SRCS+=	x25519_ref10.c scalarmult_curve25519.c crypto_scalarmult.c
88SRCS+=	poly1305_donna.c onetimeauth_poly1305.c
89SRCS+=	crypto_onetimeauth.c chacha20_ref.c stream_chacha20.c
90SRCS+=	aead_xchacha20poly1305.c aead_chacha20poly1305.c
91SRCS+=	core_hchacha20.c ed25519_ref10.c
92
93.include <bsd.lib.mk>
94.include <bsd.klinks.mk>
95