freebsd-dev/sys/dev/random
Conrad Meyer ab69c4858c Fortuna: Add Chacha20 as an alternative stream cipher
Chacha20 with a 256 bit key and 128 bit counter size is a good match for an
AES256-ICM replacement.

In userspace, Chacha20 is typically marginally slower than AES-ICM on
machines with AESNI intrinsics, but typically much faster than AES on
machines without special intrinsics.  ChaCha20 does well on typical modern
architectures with SIMD instructions, which includes most types of machines
FreeBSD runs on.

In the kernel, we can't (or don't) make use of AESNI intrinsics for
random(4) anyway.  So even on amd64, using Chacha provides a modest
performance improvement in random device throughput today.

This change makes the stream cipher used by random(4) configurable at boot
time with the 'kern.random.use_chacha20_cipher' tunable.

Very rough, non-scientific measurements at the /dev/random device, on a
GENERIC-NODEBUG amd64 VM with 'pv', show a factor of 2.2x higher throughput
for Chacha20 over the existing AES-ICM mode.

Reviewed by:	delphij, markm
Approved by:	secteam (delphij)
Differential Revision:	https://reviews.freebsd.org/D19475
2019-03-08 01:17:20 +00:00
..
build.sh Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00
darn.c random: Add PowerPC 'darn' instruction entropy source 2018-08-17 03:49:07 +00:00
fortuna.c Fortuna: Add Chacha20 as an alternative stream cipher 2019-03-08 01:17:20 +00:00
fortuna.h
hash.c Fortuna: Add Chacha20 as an alternative stream cipher 2019-03-08 01:17:20 +00:00
hash.h Fortuna: Add Chacha20 as an alternative stream cipher 2019-03-08 01:17:20 +00:00
ivy.c
nehemiah.c Remove unused error return from API that cannot fail 2018-02-23 20:15:19 +00:00
other_algorithm.c Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00
other_algorithm.h Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00
random_harvestq.c random(4): Match enabled sources mask to build options 2018-10-27 15:09:35 +00:00
random_harvestq.h Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00
random_infra.c
randomdev.c random(4): Squash non-error timeout codes from tsleep(9). 2018-09-09 17:12:31 +00:00
randomdev.h
uint128.h Fortuna: Add Chacha20 as an alternative stream cipher 2019-03-08 01:17:20 +00:00
unit_test.c Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00
unit_test.h Remove the Yarrow PRNG algorithm option in accordance with due notice 2018-08-26 12:51:46 +00:00