xref: /freebsd/sys/modules/crypto/Makefile (revision 0c6274a819ffdf6d5a3713b2c0f7014840f01703)
1f544a528SMark Murray# $FreeBSD$
2f544a528SMark Murray
301d5de8fSConrad MeyerLIBSODIUM=${SRCTOP}/sys/contrib/libsodium/src/libsodium
401d5de8fSConrad Meyer
5193d9e76SEnji Cooper.PATH:	${SRCTOP}/sys/opencrypto
6193d9e76SEnji Cooper.PATH:	${SRCTOP}/sys/crypto
7193d9e76SEnji Cooper.PATH:	${SRCTOP}/sys/crypto/camellia
8193d9e76SEnji Cooper.PATH:	${SRCTOP}/sys/crypto/des
9193d9e76SEnji Cooper.PATH:	${SRCTOP}/sys/crypto/rijndael
10193d9e76SEnji Cooper.PATH:	${SRCTOP}/sys/crypto/sha2
11193d9e76SEnji Cooper.PATH:	${SRCTOP}/sys/crypto/siphash
12193d9e76SEnji Cooper.PATH:	${SRCTOP}/sys/crypto/skein
130e33efe4SConrad Meyer.PATH:	${SRCTOP}/sys/crypto/blake2
1461590291SConrad Meyer.PATH:	${SRCTOP}/sys/crypto/chacha20
150e33efe4SConrad Meyer.PATH:	${SRCTOP}/sys/contrib/libb2
16*0c6274a8SJohn Baldwin.PATH:	${LIBSODIUM}/crypto_core/ed25519/ref10
177df4c506SJohn Baldwin.PATH:	${LIBSODIUM}/crypto_core/hchacha20
1801d5de8fSConrad Meyer.PATH:	${LIBSODIUM}/crypto_onetimeauth/poly1305
1901d5de8fSConrad Meyer.PATH:	${LIBSODIUM}/crypto_onetimeauth/poly1305/donna
20*0c6274a8SJohn Baldwin.PATH:	${LIBSODIUM}/crypto_scalarmult/curve25519
21*0c6274a8SJohn Baldwin.PATH:	${LIBSODIUM}/crypto_scalarmult/curve25519/ref10
22dd2e1352SJohn Baldwin.PATH:	${LIBSODIUM}/crypto_stream/chacha20
23dd2e1352SJohn Baldwin.PATH:	${LIBSODIUM}/crypto_stream/chacha20/ref
2401d5de8fSConrad Meyer.PATH:	${LIBSODIUM}/crypto_verify/sodium
2501d5de8fSConrad Meyer.PATH:	${SRCTOP}/sys/crypto/libsodium
26f544a528SMark Murray
27f544a528SMark MurrayKMOD	= crypto
2863f0abbfSSam LefflerSRCS	= crypto.c cryptodev_if.c
2937621fd5SBruce M SimpsonSRCS	+= criov.c cryptosoft.c xform.c
307971a6f9SJohn BaldwinSRCS	+= cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c
316a3645bbSMarcel MoolenaarSRCS	+= camellia.c camellia-api.c
32f544a528SMark MurraySRCS	+= des_ecb.c des_enc.c des_setkey.c
337a3f5d11SAllan JudeSRCS	+= sha1.c sha256c.c sha512c.c
34b468a9ffSAllan JudeSRCS	+= skein.c skein_block.c
35929b476aSAllan Jude# unroll the 256 and 512 loops, half unroll the 1024
36310e81aeSEd MasteCFLAGS.skein_block.c	+= -DSKEIN_LOOP=995
3749d48f45SEd Maste.if exists(${MACHINE_ARCH}/skein_block_asm.S)
3849d48f45SEd Maste.PATH:	${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH}
3949d48f45SEd MasteSRCS	+= skein_block_asm.S
4049d48f45SEd MasteCFLAGS	+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792
4149d48f45SEd MasteACFLAGS	+= -DELF -Wa,--noexecstack
4249d48f45SEd Maste# Fully unroll all loops in the assembly optimized version
4349d48f45SEd MasteACFLAGS	+= -DSKEIN_LOOP=0
4449d48f45SEd Maste# 20201002 Add explict Makefile dependency for reenabled assembly optimized
4549d48f45SEd Maste# version. SKEIN_USE_ASM determines which routines should come from the assembly
4649d48f45SEd Maste# vs C versions, and skein_block needs to be rebuilt if it changes.
4749d48f45SEd Masteskein_block.o: Makefile
4849d48f45SEd Maste.endif
496a3645bbSMarcel MoolenaarSRCS	+= siphash.c
5008fca7a5SJohn-Mark GurneySRCS	+= gmac.c gfmult.c
510e33efe4SConrad MeyerSRCS	+= blake2b-ref.c
520e33efe4SConrad MeyerSRCS	+= blake2s-ref.c
530e33efe4SConrad MeyerSRCS	+= blake2-sw.c
540e33efe4SConrad MeyerCFLAGS.blake2b-ref.c	+= -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref
550e33efe4SConrad MeyerCFLAGS.blake2s-ref.c	+= -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref
560e33efe4SConrad MeyerCFLAGS.blake2-sw.c	+= -I${SRCTOP}/sys/crypto/blake2
57cccc969bSMatt MacyCWARNFLAGS.blake2b-ref.c	+= -Wno-cast-qual -Wno-unused-function
58cccc969bSMatt MacyCWARNFLAGS.blake2s-ref.c	+= -Wno-cast-qual -Wno-unused-function
5961590291SConrad MeyerSRCS	+= chacha.c
6061590291SConrad MeyerSRCS	+= chacha-sw.c
61e7168004SJohn BaldwinSRCS	+= chacha20_poly1305.c
6201d5de8fSConrad Meyer
6301d5de8fSConrad MeyerLIBSODIUM_INC=${LIBSODIUM}/include
6401d5de8fSConrad MeyerLIBSODIUM_COMPAT=${SRCTOP}/sys/crypto/libsodium
65dd2e1352SJohn BaldwinSRCS	+= xform_chacha20_poly1305.c
66dd2e1352SJohn BaldwinCFLAGS.xform_chacha20_poly1305.c+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
6701d5de8fSConrad MeyerSRCS	+= xform_poly1305.c
6801d5de8fSConrad MeyerCFLAGS.xform_poly1305.c		+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
69*0c6274a8SJohn BaldwinSRCS	+= ed25519_ref10.c
70*0c6274a8SJohn BaldwinCFLAGS.ed25519_ref10.c		+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
717df4c506SJohn BaldwinSRCS	+= core_hchacha20.c
727df4c506SJohn BaldwinCFLAGS.core_hchacha20.c		+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
7301d5de8fSConrad MeyerSRCS	+= onetimeauth_poly1305.c
7401d5de8fSConrad MeyerCFLAGS.onetimeauth_poly1305.c	+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
7501d5de8fSConrad MeyerSRCS	+= poly1305_donna.c
7601d5de8fSConrad MeyerCFLAGS.poly1305_donna.c		+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
778b4af206SJohn BaldwinSRCS	+= stream_chacha20.c
788b4af206SJohn BaldwinCFLAGS.stream_chacha20.c	+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
798b4af206SJohn BaldwinSRCS	+= chacha20_ref.c
808b4af206SJohn BaldwinCFLAGS.chacha20_ref.c		+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
81*0c6274a8SJohn BaldwinSRCS	+= scalarmult_curve25519.c
82*0c6274a8SJohn BaldwinCFLAGS.scalarmult_curve25519.c	+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
83*0c6274a8SJohn BaldwinSRCS	+= x25519_ref10.c
84*0c6274a8SJohn BaldwinCFLAGS.x25519_ref10.c		+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
8501d5de8fSConrad MeyerSRCS	+= verify.c
8601d5de8fSConrad MeyerCFLAGS.verify.c			+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
8701d5de8fSConrad MeyerSRCS	+= randombytes.c
8801d5de8fSConrad MeyerCFLAGS.randombytes.c		+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
8901d5de8fSConrad MeyerSRCS	+= utils.c
9001d5de8fSConrad MeyerCFLAGS.utils.c			+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
9101d5de8fSConrad Meyer
92*0c6274a8SJohn BaldwinSRCS	+= curve25519.c
93*0c6274a8SJohn BaldwinCFLAGS.curve25519.c		+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
94*0c6274a8SJohn Baldwin
9563f0abbfSSam LefflerSRCS	+= opt_param.h cryptodev_if.h bus_if.h device_if.h
968c27b7a9SJohn BaldwinSRCS	+= opt_compat.h
9754366c0bSAttilio RaoSRCS	+= opt_ddb.h
98a99bc4c3SSean Eric FaganSRCS	+= cbc_mac.c
99a99bc4c3SSean Eric FaganSRCS	+= xform_cbc_mac.c
1006a3645bbSMarcel Moolenaar
101f544a528SMark Murray.include <bsd.kmod.mk>
102