xref: /freebsd/sys/modules/crypto/Makefile (revision 9e5787d2284e187abb5b654d924394a65772e004)
1# $FreeBSD$
2
3LIBSODIUM=${SRCTOP}/sys/contrib/libsodium/src/libsodium
4
5.PATH:	${SRCTOP}/sys/opencrypto
6.PATH:	${SRCTOP}/sys/crypto
7.PATH:	${SRCTOP}/sys/crypto/camellia
8.PATH:	${SRCTOP}/sys/crypto/des
9.PATH:	${SRCTOP}/sys/crypto/rijndael
10.PATH:	${SRCTOP}/sys/crypto/sha2
11.PATH:	${SRCTOP}/sys/crypto/siphash
12.PATH:	${SRCTOP}/sys/crypto/skein
13.PATH:	${SRCTOP}/sys/crypto/blake2
14.PATH:	${SRCTOP}/sys/crypto/chacha20
15.PATH:	${SRCTOP}/sys/contrib/libb2
16.PATH:	${LIBSODIUM}/crypto_onetimeauth/poly1305
17.PATH:	${LIBSODIUM}/crypto_onetimeauth/poly1305/donna
18.PATH:	${LIBSODIUM}/crypto_verify/sodium
19.PATH:	${SRCTOP}/sys/crypto/libsodium
20
21KMOD	= crypto
22SRCS	= crypto.c cryptodev_if.c
23SRCS	+= criov.c cryptosoft.c xform.c
24SRCS	+= cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c
25SRCS	+= camellia.c camellia-api.c
26SRCS	+= des_ecb.c des_enc.c des_setkey.c
27SRCS	+= sha1.c sha256c.c sha512c.c
28SRCS	+= skein.c skein_block.c
29# unroll the 256 and 512 loops, half unroll the 1024
30CFLAGS.skein_block.c	+= -DSKEIN_LOOP=995
31#.if exists(${MACHINE_ARCH}/skein_block_asm.S)
32#.PATH:	${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH}
33#SRCS	+= skein_block_asm.S
34#CFLAGS	+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792
35#ACFLAGS	+= -DELF -Wa,--noexecstack
36## Fully unroll all loops in the assembly optimized version
37#ACFLAGS	+= -DSKEIN_LOOP=0
38#.endif
39SRCS	+= siphash.c
40SRCS	+= gmac.c gfmult.c
41SRCS	+= blake2b-ref.c
42SRCS	+= blake2s-ref.c
43SRCS	+= blake2-sw.c
44CFLAGS.blake2b-ref.c	+= -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref
45CFLAGS.blake2s-ref.c	+= -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref
46CFLAGS.blake2-sw.c	+= -I${SRCTOP}/sys/crypto/blake2
47CWARNFLAGS.blake2b-ref.c	+= -Wno-cast-qual -Wno-unused-function
48CWARNFLAGS.blake2s-ref.c	+= -Wno-cast-qual -Wno-unused-function
49SRCS	+= chacha.c
50SRCS	+= chacha-sw.c
51
52LIBSODIUM_INC=${LIBSODIUM}/include
53LIBSODIUM_COMPAT=${SRCTOP}/sys/crypto/libsodium
54SRCS	+= xform_poly1305.c
55CFLAGS.xform_poly1305.c		+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
56SRCS	+= onetimeauth_poly1305.c
57CFLAGS.onetimeauth_poly1305.c	+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
58SRCS	+= poly1305_donna.c
59CFLAGS.poly1305_donna.c		+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
60SRCS	+= verify.c
61CFLAGS.verify.c			+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
62SRCS	+= randombytes.c
63CFLAGS.randombytes.c		+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
64SRCS	+= utils.c
65CFLAGS.utils.c			+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
66
67SRCS	+= opt_param.h cryptodev_if.h bus_if.h device_if.h
68SRCS	+= opt_compat.h
69SRCS	+= opt_ddb.h
70SRCS	+= cbc_mac.c
71SRCS	+= xform_cbc_mac.c
72
73.include <bsd.kmod.mk>
74