#include <assert.h>
#include <string.h>
+/* #define YARROW_DEBUG */
+#ifdef YARROW_DEBUG
+#include <stdio.h>
+#endif
+
/* Parameters */
/* An upper limit on the entropy (in bits) in one octet of sample
uint8_t digest[SHA256_DIGEST_SIZE];
unsigned i;
+#ifdef YARROW_DEBUG
+ fprintf(stderr, "yarrow_fast_reseed\n");
+#endif
+
/* We feed two block of output using the current key into the pool
* before emptying it. */
if (ctx->seeded)
uint8_t digest[SHA256_DIGEST_SIZE];
unsigned i;
+#ifdef YARROW_DEBUG
+ fprintf(stderr, "yarrow_slow_reseed\n");
+#endif
+
/* Get digest of the slow pool*/
sha256_final(&ctx->pools[YARROW_SLOW]);
case YARROW_FAST:
if (source->estimate[YARROW_FAST] >= YARROW_FAST_THRESHOLD)
yarrow_fast_reseed(ctx);
+
+#ifdef YARROW_DEBUG
+ fprintf(stderr,
+ "yarrow256_update: source_index = %d,\n"
+ " fast pool estimate = %d\n",
+ source_index, source->estimate[YARROW_FAST]);
+#endif
break;
case YARROW_SLOW:
{
if (ctx->sources[i].estimate[YARROW_SLOW] >= YARROW_SLOW_THRESHOLD)
k++;
+#ifdef YARROW_DEBUG
+ fprintf(stderr,
+ "yarrow256_update: source_index = %d,\n"
+ " slow pool estimate = %d,\n"
+ " number of sources above threshold = %d\n",
+ source_index, source->estimate[YARROW_SLOW], k);
+#endif
+
if (k >= YARROW_SLOW_K)
{
yarrow_slow_reseed(ctx);