summaryrefslogtreecommitdiff
path: root/yarrow.h
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2001-10-07 20:51:26 +0200
committerNiels Möller <nisse@lysator.liu.se>2001-10-07 20:51:26 +0200
commite0c3262743e76cfacac1f1f7fe2cd2e3baa2af1d (patch)
tree0867494c3c5d80b39a090b0a0ed07f7042ba7957 /yarrow.h
parent5d55afabe1a44e976a9e6beae203195eb5f97a4c (diff)
downloadnettle-e0c3262743e76cfacac1f1f7fe2cd2e3baa2af1d.tar.gz
Work in progress.
Rev: src/nettle/yarrow.h:1.2
Diffstat (limited to 'yarrow.h')
-rw-r--r--yarrow.h36
1 files changed, 31 insertions, 5 deletions
diff --git a/yarrow.h b/yarrow.h
index 0b691e8a..65486532 100644
--- a/yarrow.h
+++ b/yarrow.h
@@ -26,20 +26,46 @@
#ifndef NETTLE_YARROW_COMPAT_H_INCLUDED
#define NETTLE_YARROW_COMPAT_H_INCLUDED
+#include "sha1.h"
+#include "des.h"
+
+enum yarrow_pool_id { YARROW_FAST = 0, YARROW_SLOW = 1 };
+
+struct yarrow_source
+{
+ uint32_t estimate;
+
+ /* The pool next sample should go to. */
+ enum yarrow_pool_id next;
+};
+
struct yarrow160_ctx
{
+ /* Indexed by yarrow_pool_id */
+ struct sha1_ctx pools[2];
+
+ int seeded;
+
+ struct des3_ctx key;
+
+ unsigned nsources;
+ struct yarrow_source *sources;
};
void
-yarrow160_init(struct *yarrow160_ctx);
+yarrow160_init(struct yarrow160_ctx *ctx,
+ int nsources,
+ struct yarrow_source *sources);
void
-yarrow160_update(struct *yarrow160_ctx, unsigned length, const uint8_t *data);
+yarrow160_update(struct yarrow160_ctx *ctx,
+ unsigned source, unsigned length, const uint8_t *data);
void
-yarrow160_random(struct *yarrow160_ctx, unsigned length, uint8_t dst);
+yarrow160_random(struct yarrow160_ctx *ctx, unsigned length, uint8_t dst);
+
+int
+yarrow160_seeded(struct yarrow160_ctx *ctx);
-unsigned
-yarrow160_needed(struct *yarrow160_ctx);
#endif /* NETTLE_YARROW_COMPAT_H_INCLUDED */