aboutsummaryrefslogtreecommitdiff
path: root/sys/modules
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-02-18 17:22:18 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-10-21 15:51:22 +0000
commitd5cbcae312e705fb89e2ce79c823e9d8697c6b0c (patch)
tree87bb0cef8b322fa67171e5372427e89be0e266c2 /sys/modules
parentec3872a696a9b931ca8366c616bf9efc2dbfe8f8 (diff)
downloadsrc-d5cbcae312e705fb89e2ce79c823e9d8697c6b0c.tar.gz
src-d5cbcae312e705fb89e2ce79c823e9d8697c6b0c.zip
Add an implementation of CHACHA20_POLY1305 to cryptosoft.
This uses the chacha20 IETF and poly1305 implementations from libsodium. A seperate auth_hash is created for the auth side whose Setkey method derives the poly1305 key from the AEAD key and nonce as described in RFC 8439. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27837 (cherry picked from commit dd2e1352b68aa33f7f6f8c19aaf88cf287013ae8)
Diffstat (limited to 'sys/modules')
-rw-r--r--sys/modules/crypto/Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/modules/crypto/Makefile b/sys/modules/crypto/Makefile
index 89af6ab8fc61..f64ea1f6fc8b 100644
--- a/sys/modules/crypto/Makefile
+++ b/sys/modules/crypto/Makefile
@@ -15,6 +15,8 @@ LIBSODIUM=${SRCTOP}/sys/contrib/libsodium/src/libsodium
.PATH: ${SRCTOP}/sys/contrib/libb2
.PATH: ${LIBSODIUM}/crypto_onetimeauth/poly1305
.PATH: ${LIBSODIUM}/crypto_onetimeauth/poly1305/donna
+.PATH: ${LIBSODIUM}/crypto_stream/chacha20
+.PATH: ${LIBSODIUM}/crypto_stream/chacha20/ref
.PATH: ${LIBSODIUM}/crypto_verify/sodium
.PATH: ${SRCTOP}/sys/crypto/libsodium
@@ -55,8 +57,14 @@ SRCS += chacha-sw.c
LIBSODIUM_INC=${LIBSODIUM}/include
LIBSODIUM_COMPAT=${SRCTOP}/sys/crypto/libsodium
+SRCS += xform_chacha20_poly1305.c
+CFLAGS.xform_chacha20_poly1305.c+= -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
SRCS += xform_poly1305.c
CFLAGS.xform_poly1305.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
+SRCS += stream_chacha20.c
+CFLAGS.stream_chacha20.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
+SRCS += chacha20_ref.c
+CFLAGS.chacha20_ref.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
SRCS += onetimeauth_poly1305.c
CFLAGS.onetimeauth_poly1305.c += -I${LIBSODIUM_INC}/sodium -I${LIBSODIUM_COMPAT}
SRCS += poly1305_donna.c
@@ -67,7 +75,6 @@ SRCS += randombytes.c
CFLAGS.randombytes.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
SRCS += utils.c
CFLAGS.utils.c += -I${LIBSODIUM_INC} -I${LIBSODIUM_COMPAT}
-SRCS += xform_chacha20_poly1305.c
SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h
SRCS += opt_compat.h