freebsd-dev/tests/sys/devrandom/Makefile
Conrad Meyer 403c041316 random(4): Add regression tests for uint128 implementation, Chacha CTR
Add some basic regression tests to verify behavior of both uint128
implementations at typical boundary conditions, to run on all architectures.

Test uint128 increment behavior of Chacha in keystream mode, as used by
'kern.random.use_chacha20_cipher=1' (r344913) to verify assumptions at edge
cases.  These assumptions are critical to the safety of using Chacha as a
PRF in Fortuna (as implemented).

(Chacha's use in arc4random is safe regardless of these tests, as it is
limited to far less than 4 billion blocks of output in that API.)

Reviewed by:	markm
Approved by:	secteam(gordon)
Differential Revision:	https://reviews.freebsd.org/D20392
2019-06-17 14:59:45 +00:00

27 lines
579 B
Makefile

# $FreeBSD$
.include <src.opts.mk>
SDEVRANDOM= ${SRCTOP}/sys/dev/random
.PATH: ${SDEVRANDOM}
TESTSDIR= ${TESTSBASE}/sys/devrandom
WARNS?= 6
CFLAGS+= -I${SRCTOP}/sys
ATF_TESTS_C+= uint128_test
# Test Chacha CTR behavior <-> uint128
LDADD.uint128_test+= ${SDEVRANDOM}/hash.c
LDFLAGS.uint128_test+= -Wno-unused-parameter
# hash.c deps:
LIBADD.uint128_test+= md # SHA256
LDADD.uint128_test+= ${SRCTOP}/sys/crypto/rijndael/rijndael-alg-fst.c
LDADD.uint128_test+= ${SRCTOP}/sys/crypto/rijndael/rijndael-api-fst.c
LDFLAGS.uint128_test+= -Wno-cast-align
.include <bsd.test.mk>