diff options
author | Niels Möller <nisse@lysator.liu.se> | 2001-10-07 20:51:26 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2001-10-07 20:51:26 +0200 |
commit | e0c3262743e76cfacac1f1f7fe2cd2e3baa2af1d (patch) | |
tree | 0867494c3c5d80b39a090b0a0ed07f7042ba7957 /yarrow.h | |
parent | 5d55afabe1a44e976a9e6beae203195eb5f97a4c (diff) | |
download | nettle-e0c3262743e76cfacac1f1f7fe2cd2e3baa2af1d.tar.gz |
Work in progress.
Rev: src/nettle/yarrow.h:1.2
Diffstat (limited to 'yarrow.h')
-rw-r--r-- | yarrow.h | 36 |
1 files changed, 31 insertions, 5 deletions
@@ -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 */ |