Skip to content
Snippets Groups Projects
Commit e0c32627 authored by Niels Möller's avatar Niels Möller
Browse files

Work in progress.

Rev: src/nettle/yarrow.h:1.2
parent 5d55afab
No related branches found
No related tags found
No related merge requests found
...@@ -26,20 +26,46 @@ ...@@ -26,20 +26,46 @@
#ifndef NETTLE_YARROW_COMPAT_H_INCLUDED #ifndef NETTLE_YARROW_COMPAT_H_INCLUDED
#define 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 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 void
yarrow160_init(struct *yarrow160_ctx); yarrow160_init(struct yarrow160_ctx *ctx,
int nsources,
struct yarrow_source *sources);
void 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 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 */ #endif /* NETTLE_YARROW_COMPAT_H_INCLUDED */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment