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