diff options
author | markm <markm@FreeBSD.org> | 2013-08-26 18:29:51 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2013-08-26 18:29:51 +0000 |
commit | e007bbae78703d83fd29b3ba2507dfcac7e45b44 (patch) | |
tree | c6b9fa1a072b3a044fc794152e9ae4ec68733c7d /sys/dev/random/hash.h | |
parent | bd5fc148c56b178ea549ad2e722738a8d6d81503 (diff) | |
download | FreeBSD-src-e007bbae78703d83fd29b3ba2507dfcac7e45b44.zip FreeBSD-src-e007bbae78703d83fd29b3ba2507dfcac7e45b44.tar.gz |
Snapshot of current work;
1) Clean up namespace; only use "Yarrow" where it is Yarrow-specific
or close enough to the Yarrow algorithm. For the rest use a neutral
name.
2) Tidy up headers; put private stuff in private places. More could
be done here.
3) Streamline the hashing/encryption; no need for a 256-bit counter;
128 bits will last for long enough.
There are bits of debug code lying around; these will be removed
at a later stage.
Diffstat (limited to 'sys/dev/random/hash.h')
-rw-r--r-- | sys/dev/random/hash.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/dev/random/hash.h b/sys/dev/random/hash.h index 8580d14..62f116d 100644 --- a/sys/dev/random/hash.h +++ b/sys/dev/random/hash.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2004 Mark R V Murray + * Copyright (c) 2000-2013 Mark R V Murray * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,19 +26,20 @@ * $FreeBSD$ */ -#define KEYSIZE 32 /* (in bytes) 32 bytes == 256 bits */ +#define KEYSIZE 32 /* (in bytes) == 256 bits */ +#define BLOCKSIZE 16 /* (in bytes) == 128 bits */ -struct yarrowhash { /* Big! Make static! */ +struct randomdev_hash { /* Big! Make static! */ SHA256_CTX sha; }; -struct yarrowkey { /* Big! Make static! */ +struct randomdev_key { /* Big! Make static! */ keyInstance key; /* Key schedule */ cipherInstance cipher; /* Rijndael internal */ }; -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 *); -void yarrow_encrypt(struct yarrowkey *context, void *, void *); +void randomdev_hash_init(struct randomdev_hash *); +void randomdev_hash_iterate(struct randomdev_hash *, void *, size_t); +void randomdev_hash_finish(struct randomdev_hash *, void *); +void randomdev_encrypt_init(struct randomdev_key *, void *); +void randomdev_encrypt(struct randomdev_key *context, void *, void *, unsigned); |