3 LIBSODIUM=${SRCTOP}/sys/contrib/libsodium/src/libsodium
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_stream/chacha20
19 .PATH: ${LIBSODIUM}/crypto_stream/chacha20/ref
20 .PATH: ${LIBSODIUM}/crypto_verify/sodium
21 .PATH: ${SRCTOP}/sys/crypto/libsodium
24 SRCS = crypto.c cryptodev_if.c
25 SRCS += criov.c cryptosoft.c xform.c
26 SRCS += cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c
27 SRCS += camellia.c camellia-api.c
28 SRCS += des_ecb.c des_enc.c des_setkey.c
29 SRCS += sha1.c sha256c.c sha512c.c
30 SRCS += skein.c skein_block.c
31 # unroll the 256 and 512 loops, half unroll the 1024
32 CFLAGS.skein_block.c += -DSKEIN_LOOP=995
33 .if exists(${MACHINE_ARCH}/skein_block_asm.S)
34 .PATH: ${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH}
35 SRCS += skein_block_asm.S
36 CFLAGS += -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792
37 ACFLAGS += -DELF -Wa,--noexecstack
38 # Fully unroll all loops in the assembly optimized version
39 ACFLAGS += -DSKEIN_LOOP=0
40 # 20201002 Add explict Makefile dependency for reenabled assembly optimized
41 # version. SKEIN_USE_ASM determines which routines should come from the assembly
42 # vs C versions, and skein_block needs to be rebuilt if it changes.
43 skein_block.o: Makefile
46 SRCS += gmac.c gfmult.c
50 CFLAGS.blake2b-ref.c += -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref
51 CFLAGS.blake2s-ref.c += -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref
52 CFLAGS.blake2-sw.c += -I${SRCTOP}/sys/crypto/blake2
53 CWARNFLAGS.blake2b-ref.c += -Wno-cast-qual -Wno-unused-function
54 CWARNFLAGS.blake2s-ref.c += -Wno-cast-qual -Wno-unused-function
58 LIBSODIUM_INC=${LIBSODIUM}/include
59 LIBSODIUM_COMPAT=${SRCTOP}/sys/crypto/libsodium
60 SRCS += xform_chacha20_poly1305.c
61 CFLAGS.xform_chacha20_poly1305.c+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
62 SRCS += xform_poly1305.c
63 CFLAGS.xform_poly1305.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
64 SRCS += stream_chacha20.c
65 CFLAGS.stream_chacha20.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
66 SRCS += chacha20_ref.c
67 CFLAGS.chacha20_ref.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
68 SRCS += onetimeauth_poly1305.c
69 CFLAGS.onetimeauth_poly1305.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
70 SRCS += poly1305_donna.c
71 CFLAGS.poly1305_donna.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
73 CFLAGS.verify.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
75 CFLAGS.randombytes.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
77 CFLAGS.utils.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
79 SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h
83 SRCS += xform_cbc_mac.c
85 .include <bsd.kmod.mk>