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