summaryrefslogtreecommitdiffstats
path: root/sys/dev/random/hash.h
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2013-08-26 18:29:51 +0000
committermarkm <markm@FreeBSD.org>2013-08-26 18:29:51 +0000
commite007bbae78703d83fd29b3ba2507dfcac7e45b44 (patch)
treec6b9fa1a072b3a044fc794152e9ae4ec68733c7d /sys/dev/random/hash.h
parentbd5fc148c56b178ea549ad2e722738a8d6d81503 (diff)
downloadFreeBSD-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.h19
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);
OpenPOWER on IntegriCloud