101d5de8fSConrad MeyerLIBSODIUM=${SRCTOP}/sys/contrib/libsodium/src/libsodium 201d5de8fSConrad Meyer 3193d9e76SEnji Cooper.PATH: ${SRCTOP}/sys/opencrypto 4193d9e76SEnji Cooper.PATH: ${SRCTOP}/sys/crypto 5193d9e76SEnji Cooper.PATH: ${SRCTOP}/sys/crypto/camellia 6193d9e76SEnji Cooper.PATH: ${SRCTOP}/sys/crypto/des 7193d9e76SEnji Cooper.PATH: ${SRCTOP}/sys/crypto/rijndael 8193d9e76SEnji Cooper.PATH: ${SRCTOP}/sys/crypto/sha2 9193d9e76SEnji Cooper.PATH: ${SRCTOP}/sys/crypto/siphash 10193d9e76SEnji Cooper.PATH: ${SRCTOP}/sys/crypto/skein 110e33efe4SConrad Meyer.PATH: ${SRCTOP}/sys/crypto/blake2 1261590291SConrad Meyer.PATH: ${SRCTOP}/sys/crypto/chacha20 130e33efe4SConrad Meyer.PATH: ${SRCTOP}/sys/contrib/libb2 140c6274a8SJohn Baldwin.PATH: ${LIBSODIUM}/crypto_core/ed25519/ref10 157df4c506SJohn Baldwin.PATH: ${LIBSODIUM}/crypto_core/hchacha20 1601d5de8fSConrad Meyer.PATH: ${LIBSODIUM}/crypto_onetimeauth/poly1305 1701d5de8fSConrad Meyer.PATH: ${LIBSODIUM}/crypto_onetimeauth/poly1305/donna 180c6274a8SJohn Baldwin.PATH: ${LIBSODIUM}/crypto_scalarmult/curve25519 190c6274a8SJohn Baldwin.PATH: ${LIBSODIUM}/crypto_scalarmult/curve25519/ref10 20dd2e1352SJohn Baldwin.PATH: ${LIBSODIUM}/crypto_stream/chacha20 21dd2e1352SJohn Baldwin.PATH: ${LIBSODIUM}/crypto_stream/chacha20/ref 2201d5de8fSConrad Meyer.PATH: ${LIBSODIUM}/crypto_verify/sodium 2301d5de8fSConrad Meyer.PATH: ${SRCTOP}/sys/crypto/libsodium 24f544a528SMark Murray 25f544a528SMark MurrayKMOD = crypto 2663f0abbfSSam LefflerSRCS = crypto.c cryptodev_if.c 2716cf646aSJohn BaldwinSRCS += criov.c cryptosoft.c 2816cf646aSJohn BaldwinSRCS += xform_aes_cbc.c xform_aes_icm.c xform_aes_xts.c xform_cml.c 2916cf646aSJohn BaldwinSRCS += xform_deflate.c xform_gmac.c xform_null.c xform_rmd160.c 3016cf646aSJohn BaldwinSRCS += xform_sha1.c xform_sha2.c 317971a6f9SJohn BaldwinSRCS += cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c 326a3645bbSMarcel MoolenaarSRCS += camellia.c camellia-api.c 33f544a528SMark MurraySRCS += des_ecb.c des_enc.c des_setkey.c 347a3f5d11SAllan JudeSRCS += sha1.c sha256c.c sha512c.c 35b468a9ffSAllan JudeSRCS += skein.c skein_block.c 36929b476aSAllan Jude# unroll the 256 and 512 loops, half unroll the 1024 37310e81aeSEd MasteCFLAGS.skein_block.c += -DSKEIN_LOOP=995 3849d48f45SEd Maste.if exists(${MACHINE_ARCH}/skein_block_asm.S) 3949d48f45SEd Maste.PATH: ${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH} 4049d48f45SEd MasteSRCS += skein_block_asm.S 4149d48f45SEd MasteCFLAGS += -DSKEIN_ASM -DSKEIN_USE_ASM=1792 # list of block functions to replace with assembly: 256+512+1024 = 1792 4249d48f45SEd MasteACFLAGS += -DELF -Wa,--noexecstack 4349d48f45SEd Maste# Fully unroll all loops in the assembly optimized version 4449d48f45SEd MasteACFLAGS += -DSKEIN_LOOP=0 4549d48f45SEd Maste# 20201002 Add explict Makefile dependency for reenabled assembly optimized 4649d48f45SEd Maste# version. SKEIN_USE_ASM determines which routines should come from the assembly 4749d48f45SEd Maste# vs C versions, and skein_block needs to be rebuilt if it changes. 4849d48f45SEd Masteskein_block.o: Makefile 4949d48f45SEd Maste.endif 506a3645bbSMarcel MoolenaarSRCS += siphash.c 5108fca7a5SJohn-Mark GurneySRCS += gmac.c gfmult.c 520e33efe4SConrad MeyerSRCS += blake2b-ref.c 530e33efe4SConrad MeyerSRCS += blake2s-ref.c 540e33efe4SConrad MeyerSRCS += blake2-sw.c 550e33efe4SConrad MeyerCFLAGS.blake2b-ref.c += -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref 560e33efe4SConrad MeyerCFLAGS.blake2s-ref.c += -I${SRCTOP}/sys/crypto/blake2 -DSUFFIX=_ref 570e33efe4SConrad MeyerCFLAGS.blake2-sw.c += -I${SRCTOP}/sys/crypto/blake2 58cccc969bSMatt MacyCWARNFLAGS.blake2b-ref.c += -Wno-cast-qual -Wno-unused-function 59cccc969bSMatt MacyCWARNFLAGS.blake2s-ref.c += -Wno-cast-qual -Wno-unused-function 6061590291SConrad MeyerSRCS += chacha.c 6161590291SConrad MeyerSRCS += chacha-sw.c 62e7168004SJohn BaldwinSRCS += chacha20_poly1305.c 6301d5de8fSConrad Meyer 6401d5de8fSConrad MeyerLIBSODIUM_INC=${LIBSODIUM}/include 6501d5de8fSConrad MeyerLIBSODIUM_COMPAT=${SRCTOP}/sys/crypto/libsodium 66dd2e1352SJohn BaldwinSRCS += xform_chacha20_poly1305.c 67dd2e1352SJohn BaldwinCFLAGS.xform_chacha20_poly1305.c+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT} 6801d5de8fSConrad MeyerSRCS += xform_poly1305.c 6901d5de8fSConrad MeyerCFLAGS.xform_poly1305.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT} 700c6274a8SJohn BaldwinSRCS += ed25519_ref10.c 710c6274a8SJohn BaldwinCFLAGS.ed25519_ref10.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT} 72*63b7c2dfSJohn BaldwinCWARNFLAGS.ed25519_ref10.c += -Wno-unused-function 737df4c506SJohn BaldwinSRCS += core_hchacha20.c 747df4c506SJohn BaldwinCFLAGS.core_hchacha20.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT} 7501d5de8fSConrad MeyerSRCS += onetimeauth_poly1305.c 7601d5de8fSConrad MeyerCFLAGS.onetimeauth_poly1305.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT} 7701d5de8fSConrad MeyerSRCS += poly1305_donna.c 7801d5de8fSConrad MeyerCFLAGS.poly1305_donna.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT} 798b4af206SJohn BaldwinSRCS += stream_chacha20.c 808b4af206SJohn BaldwinCFLAGS.stream_chacha20.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT} 818b4af206SJohn BaldwinSRCS += chacha20_ref.c 828b4af206SJohn BaldwinCFLAGS.chacha20_ref.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT} 830c6274a8SJohn BaldwinSRCS += scalarmult_curve25519.c 840c6274a8SJohn BaldwinCFLAGS.scalarmult_curve25519.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT} 850c6274a8SJohn BaldwinSRCS += x25519_ref10.c 860c6274a8SJohn BaldwinCFLAGS.x25519_ref10.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT} 87*63b7c2dfSJohn BaldwinCWARNFLAGS.x25519_ref10.c += -Wno-unused-function 8801d5de8fSConrad MeyerSRCS += verify.c 8901d5de8fSConrad MeyerCFLAGS.verify.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT} 9001d5de8fSConrad MeyerSRCS += randombytes.c 9101d5de8fSConrad MeyerCFLAGS.randombytes.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT} 9201d5de8fSConrad MeyerSRCS += utils.c 9301d5de8fSConrad MeyerCFLAGS.utils.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT} 9401d5de8fSConrad Meyer 950c6274a8SJohn BaldwinSRCS += curve25519.c 960c6274a8SJohn BaldwinCFLAGS.curve25519.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT} 970c6274a8SJohn Baldwin 9863f0abbfSSam LefflerSRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h 9954366c0bSAttilio RaoSRCS += opt_ddb.h 100a99bc4c3SSean Eric FaganSRCS += cbc_mac.c 101a99bc4c3SSean Eric FaganSRCS += xform_cbc_mac.c 1026a3645bbSMarcel Moolenaar 103f544a528SMark Murray.include <bsd.kmod.mk> 104