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