1# $FreeBSD$ 2 3 4KMOD= if_wg 5 6INCDIR= ${SRCTOP}/sys/dev/if_wg/include 7ZINCDIR= ${SRCTOP}/sys/dev/if_wg/module/crypto/zinc 8 9.PATH: ${SRCTOP}/sys/dev/if_wg/module 10.PATH: ${ZINCDIR} 11.PATH: ${ZINCDIR}/chacha20 12.PATH: ${ZINCDIR}/poly1305 13 14CFLAGS+= -I${INCDIR} 15 16CFLAGS+= -D__KERNEL__ 17 18SRCS= opt_inet.h opt_inet6.h device_if.h bus_if.h ifdi_if.h 19 20SRCS+= if_wg_session.c module.c 21SRCS+= wg_noise.c wg_cookie.c 22SRCS+= curve25519.c blake2s.c 23SRCS+= chacha20poly1305.c chacha20.c poly1305.c 24 25.if ${MACHINE_ARCH} == "amd64" 26SRCS += poly1305-x86_64.S chacha20-x86_64.S 27SIMD_FLAGS = -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_AVX=1 \ 28 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_AVX2=1 29.endif 30.include <bsd.kmod.mk> 31 32.if ${MACHINE_ARCH} == "amd64" 33CFLAGS.poly1305-x86_64.S = -D__LOCORE -gdwarf-4 ${SIMD_FLAGS} -include ${INCDIR}/sys/support.h 34CFLAGS.chacha20-x86_64.S = -D__LOCORE -gdwarf-4 ${SIMD_FLAGS} -include ${INCDIR}/sys/support.h 35CFLAGS.chacha20poly1305.c = -DCONFIG_ZINC_ARCH_X86_64 36CFLAGS.chacha20.c = -DCONFIG_ZINC_ARCH_X86_64 37CFLAGS.poly1305.c = -DCONFIG_ZINC_ARCH_X86_64 38.endif 39