xref: /freebsd/sys/modules/crypto/Makefile (revision abd872540f24cfc7dbd1ea29b6918c7082a22108)
1
2LIBSODIUM=${SRCTOP}/sys/contrib/libsodium/src/libsodium
3
4.PATH:	${SRCTOP}/sys/opencrypto
5.PATH:	${SRCTOP}/sys/crypto
6.PATH:	${SRCTOP}/sys/crypto/camellia
7.PATH:	${SRCTOP}/sys/crypto/des
8.PATH:	${SRCTOP}/sys/crypto/rijndael
9.PATH:	${SRCTOP}/sys/crypto/sha2
10.PATH:	${SRCTOP}/sys/crypto/siphash
11.PATH:	${SRCTOP}/sys/crypto/skein
12.PATH:	${SRCTOP}/sys/crypto/blake2
13.PATH:	${SRCTOP}/sys/crypto/chacha20
14.PATH:	${SRCTOP}/sys/contrib/libb2
15.PATH:	${LIBSODIUM}/crypto_core/ed25519/ref10
16.PATH:	${LIBSODIUM}/crypto_core/hchacha20
17.PATH:	${LIBSODIUM}/crypto_onetimeauth/poly1305
18.PATH:	${LIBSODIUM}/crypto_onetimeauth/poly1305/donna
19.PATH:	${LIBSODIUM}/crypto_scalarmult/curve25519
20.PATH:	${LIBSODIUM}/crypto_scalarmult/curve25519/ref10
21.PATH:	${LIBSODIUM}/crypto_stream/chacha20
22.PATH:	${LIBSODIUM}/crypto_stream/chacha20/ref
23.PATH:	${LIBSODIUM}/crypto_verify/sodium
24.PATH:	${SRCTOP}/sys/crypto/libsodium
25
26KMOD	= crypto
27SRCS	= crypto.c cryptodev_if.c
28SRCS	+= criov.c cryptosoft.c
29SRCS	+= xform_aes_cbc.c xform_aes_icm.c xform_aes_xts.c xform_cml.c
30SRCS	+= xform_deflate.c xform_gmac.c xform_null.c xform_rmd160.c
31SRCS	+= xform_sha1.c xform_sha2.c
32SRCS	+= cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c
33SRCS	+= camellia.c camellia-api.c
34SRCS	+= des_ecb.c des_enc.c des_setkey.c
35SRCS	+= sha1.c sha256c.c sha512c.c
36SRCS	+= skein.c skein_block.c
37# unroll the 256 and 512 loops, half unroll the 1024
38CFLAGS.skein_block.c	+= -DSKEIN_LOOP=995
39.if exists(${MACHINE_ARCH}/skein_block_asm.S)
40.PATH:	${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH}
41SRCS	+= skein_block_asm.S
42CFLAGS	+= -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792
43ACFLAGS	+= -DELF -Wa,--noexecstack
44# Fully unroll all loops in the assembly optimized version
45ACFLAGS	+= -DSKEIN_LOOP=0
46# 20201002 Add explict Makefile dependency for reenabled assembly optimized
47# version. SKEIN_USE_ASM determines which routines should come from the assembly
48# vs C versions, and skein_block needs to be rebuilt if it changes.
49skein_block.o: Makefile
50.endif
51SRCS	+= siphash.c
52SRCS	+= gmac.c gfmult.c
53SRCS	+= blake2b-ref.c
54SRCS	+= blake2s-ref.c
55SRCS	+= blake2-sw.c
56CFLAGS.blake2b-ref.c	+= -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref
57CFLAGS.blake2s-ref.c	+= -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref
58CFLAGS.blake2-sw.c	+= -I${SRCTOP}/sys/crypto/blake2
59CWARNFLAGS.blake2b-ref.c	+= -Wno-cast-qual -Wno-unused-function
60CWARNFLAGS.blake2s-ref.c	+= -Wno-cast-qual -Wno-unused-function
61SRCS	+= chacha.c
62SRCS	+= chacha-sw.c
63SRCS	+= chacha20_poly1305.c
64
65LIBSODIUM_INC=${LIBSODIUM}/include
66LIBSODIUM_COMPAT=${SRCTOP}/sys/crypto/libsodium
67SRCS	+= xform_chacha20_poly1305.c
68CFLAGS.xform_chacha20_poly1305.c+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
69SRCS	+= xform_poly1305.c
70CFLAGS.xform_poly1305.c		+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
71SRCS	+= ed25519_ref10.c
72CFLAGS.ed25519_ref10.c		+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
73CWARNFLAGS.ed25519_ref10.c	+= -Wno-unused-function
74SRCS	+= core_hchacha20.c
75CFLAGS.core_hchacha20.c		+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
76SRCS	+= onetimeauth_poly1305.c
77CFLAGS.onetimeauth_poly1305.c	+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
78SRCS	+= poly1305_donna.c
79CFLAGS.poly1305_donna.c		+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
80SRCS	+= stream_chacha20.c
81CFLAGS.stream_chacha20.c	+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
82SRCS	+= chacha20_ref.c
83CFLAGS.chacha20_ref.c		+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
84SRCS	+= scalarmult_curve25519.c
85CFLAGS.scalarmult_curve25519.c	+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
86SRCS	+= x25519_ref10.c
87CFLAGS.x25519_ref10.c		+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
88CWARNFLAGS.x25519_ref10.c	+= -Wno-unused-function
89SRCS	+= verify.c
90CFLAGS.verify.c			+= -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
91SRCS	+= randombytes.c
92CFLAGS.randombytes.c		+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
93SRCS	+= utils.c
94CFLAGS.utils.c			+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
95
96SRCS	+= curve25519.c
97CFLAGS.curve25519.c		+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
98
99SRCS	+= opt_param.h cryptodev_if.h bus_if.h device_if.h
100SRCS	+= opt_ddb.h
101SRCS	+= cbc_mac.c
102SRCS	+= xform_cbc_mac.c
103
104.include <bsd.kmod.mk>
105