2 LIBSODIUM=${SRCTOP}/sys/contrib/libsodium/src/libsodium
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
27 SRCS = crypto.c cryptodev_if.c
28 SRCS += criov.c cryptosoft.c
29 SRCS += xform_aes_cbc.c xform_aes_icm.c xform_aes_xts.c xform_cml.c
30 SRCS += xform_deflate.c xform_gmac.c xform_null.c xform_rmd160.c
31 SRCS += xform_sha1.c xform_sha2.c
32 SRCS += cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c
33 SRCS += camellia.c camellia-api.c
34 SRCS += des_ecb.c des_enc.c des_setkey.c
35 SRCS += sha1.c sha256c.c sha512c.c
36 SRCS += skein.c skein_block.c
37 # unroll the 256 and 512 loops, half unroll the 1024
38 CFLAGS.skein_block.c += -DSKEIN_LOOP=995
39 .if exists(${MACHINE_ARCH}/skein_block_asm.S)
40 .PATH: ${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH}
41 SRCS += skein_block_asm.S
42 CFLAGS += -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792
43 ACFLAGS += -DELF -Wa,--noexecstack
44 # Fully unroll all loops in the assembly optimized version
45 ACFLAGS += -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.
49 skein_block.o: Makefile
52 SRCS += gmac.c gfmult.c
56 CFLAGS.blake2b-ref.c += -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref
57 CFLAGS.blake2s-ref.c += -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref
58 CFLAGS.blake2-sw.c += -I${SRCTOP}/sys/crypto/blake2
59 CWARNFLAGS.blake2b-ref.c += -Wno-cast-qual -Wno-unused-function
60 CWARNFLAGS.blake2s-ref.c += -Wno-cast-qual -Wno-unused-function
63 SRCS += chacha20_poly1305.c
65 LIBSODIUM_INC=${LIBSODIUM}/include
66 LIBSODIUM_COMPAT=${SRCTOP}/sys/crypto/libsodium
67 SRCS += xform_chacha20_poly1305.c
68 CFLAGS.xform_chacha20_poly1305.c+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
69 SRCS += xform_poly1305.c
70 CFLAGS.xform_poly1305.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
71 SRCS += ed25519_ref10.c
72 CFLAGS.ed25519_ref10.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
73 CWARNFLAGS.ed25519_ref10.c += -Wno-unused-function
74 SRCS += core_hchacha20.c
75 CFLAGS.core_hchacha20.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
76 SRCS += onetimeauth_poly1305.c
77 CFLAGS.onetimeauth_poly1305.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
78 SRCS += poly1305_donna.c
79 CFLAGS.poly1305_donna.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
80 SRCS += stream_chacha20.c
81 CFLAGS.stream_chacha20.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
82 SRCS += chacha20_ref.c
83 CFLAGS.chacha20_ref.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
84 SRCS += scalarmult_curve25519.c
85 CFLAGS.scalarmult_curve25519.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
86 SRCS += x25519_ref10.c
87 CFLAGS.x25519_ref10.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
88 CWARNFLAGS.x25519_ref10.c += -Wno-unused-function
90 CFLAGS.verify.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
92 CFLAGS.randombytes.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
94 CFLAGS.utils.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
97 CFLAGS.curve25519.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
99 SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h
102 SRCS += xform_cbc_mac.c
104 .include <bsd.kmod.mk>