NetBSD/sys/dev/iscsi
tls 6e1dd068e9 Separate /dev/random pseudodevice implemenation from kernel entropy pool
implementation.  Rewrite pseudodevice code to use cprng_strong(9).

The new pseudodevice is cloning, so each caller gets bits from a stream
generated with its own key.  Users of /dev/urandom get their generators
keyed on a "best effort" basis -- the kernel will rekey generators
whenever the entropy pool hits the high water mark -- while users of
/dev/random get their generators rekeyed every time key-length bits
are output.

The underlying cprng_strong API can use AES-256 or AES-128, but we use
AES-128 because of concerns about related-key attacks on AES-256.  This
improves performance (and reduces entropy pool depletion) significantly
for users of /dev/urandom but does cause users of /dev/random to rekey
twice as often.

Also fixes various bugs (including some missing locking and a reseed-counter
overflow in the CTR_DRBG code) found while testing this.

For long reads, this generator is approximately 20 times as fast as the
old generator (dd with bs=64K yields 53MB/sec on 2Ghz Core2 instead of
2.5MB/sec) and also uses a separate mutex per instance so concurrency
is greatly improved.  For reads of typical key sizes for modern
cryptosystems (16-32 bytes) performance is about the same as the old
code: a little better for 32 bytes, a little worse for 16 bytes.
2011-12-17 20:05:38 +00:00
..
Makefile
base64.c
base64.h
files.iscsi Don't add iscsi_utils.c without 'iscsi' condition. 2011-11-09 00:51:00 +00:00
iscsi.h grab major 203 for the iSCSI communications device (between kernel 2011-11-19 16:41:55 +00:00
iscsi_globals.h Remove rnd_extract_data from the public kernel API (it is for use by the 2011-11-29 03:50:31 +00:00
iscsi_ioctl.c
iscsi_ioctl.h
iscsi_main.c
iscsi_pdu.h
iscsi_perf.h
iscsi_profile.c
iscsi_profile.h
iscsi_rcv.c
iscsi_send.c
iscsi_test.c Remove rnd_extract_data from the public kernel API (it is for use by the 2011-11-29 03:50:31 +00:00
iscsi_test.h
iscsi_testlocal.h
iscsi_text.c Separate /dev/random pseudodevice implemenation from kernel entropy pool 2011-12-17 20:05:38 +00:00
iscsi_utils.c