diff options
author | markm <markm@FreeBSD.org> | 2001-03-10 12:51:55 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2001-03-10 12:51:55 +0000 |
commit | ad4dd3b5a22959becd824aa989ac27a7b27e037e (patch) | |
tree | 46e10e74c3796f985f882d072fc9ecd912b67560 /sys/dev/random/hash.h | |
parent | a9b8e8be5d560774accffee6d14de8dfce8c81ba (diff) | |
download | FreeBSD-src-ad4dd3b5a22959becd824aa989ac27a7b27e037e.zip FreeBSD-src-ad4dd3b5a22959becd824aa989ac27a7b27e037e.tar.gz |
Very large makeover of the /dev/random driver.
o Separate the kernel stuff from the Yarrow algorithm. Yarrow is now
well contained in one source file and one header.
o Replace the Blowfish-based crypto routines with Rijndael-based ones.
(Rijndael is the new AES algorithm). The huge improvement in
Rijndael's key-agility over Blowfish means that this is an
extremely dramatic improvement in speed, and makes a heck of
a difference in its (lack of) CPU load.
o Clean up the sysctl's. At BDE's prompting, I have gone back to
static sysctls.
o Bug fixes. The streamlining of the crypto stuff enabled me to
find and fix some bugs. DES also found a bug in the reseed routine
which is fixed.
o Change the way reseeds clear "used" entropy. Previously, only the
source(s) that caused a reseed were cleared. Now all sources in the
relevant pool(s) are cleared.
o Code tidy-up. Mostly to make it (nearly) 80-column compliant.
Diffstat (limited to 'sys/dev/random/hash.h')
-rw-r--r-- | sys/dev/random/hash.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/random/hash.h b/sys/dev/random/hash.h index f210f13..99f0b48 100644 --- a/sys/dev/random/hash.h +++ b/sys/dev/random/hash.h @@ -26,21 +26,23 @@ * $FreeBSD$ */ -#define KEYSIZE 32 /* 32 bytes == 256 bits */ +#define KEYSIZE 32 /* in bytes - 32 bytes == 256 bits */ struct yarrowhash { /* Big! Make static! */ - BF_KEY hashkey; /* Data cycles through here */ - u_char ivec[8]; /* Blowfish Internal */ + keyInstance hashkey; /* Data cycles through here */ + cipherInstance cipher; /* Rijndael internal */ u_char hash[KEYSIZE]; /* Repeatedly encrypted */ + u_char accum[KEYSIZE]; /* Accumulate partial chunks */ + u_int partial; /* Keep track of < KEYSIZE chunks */ }; struct yarrowkey { /* Big! Make static! */ - BF_KEY key; /* Key schedule */ - u_char ivec[8]; /* Blowfish Internal */ + keyInstance key; /* Key schedule */ + cipherInstance cipher; /* Rijndael internal */ }; -void yarrow_hash_init(struct yarrowhash *, void *, size_t); +void yarrow_hash_init(struct yarrowhash *); void yarrow_hash_iterate(struct yarrowhash *, void *, size_t); void yarrow_hash_finish(struct yarrowhash *, void *); -void yarrow_encrypt_init(struct yarrowkey *, void *, size_t); -void yarrow_encrypt(struct yarrowkey *context, void *, void *, size_t); +void yarrow_encrypt_init(struct yarrowkey *, void *); +void yarrow_encrypt(struct yarrowkey *context, void *, void *); |