]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
(yarrow_slow_reseed): Bug fix, update the fast pool
authorNiels Möller <nisse@lysator.liu.se>
Wed, 12 Dec 2001 10:06:22 +0000 (11:06 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Wed, 12 Dec 2001 10:06:22 +0000 (11:06 +0100)
with the digest of the slow pool.
(yarrow256_init): Initialize seed_file and counter to zero, to
ease debugging.

Rev: src/nettle/yarrow256.c:1.14

yarrow256.c

index af3160d91d1cb8747d313be6681955da9a6f125a..ad6c3b5604961686435295308d9e41533b248c8f 100644 (file)
@@ -84,6 +84,11 @@ yarrow256_init(struct yarrow256_ctx *ctx,
   
   ctx->seeded = 0;
 
+  /* Not strictly, necessary, but it makes it easier to see if the
+   * values are sane. */
+  memset(ctx->seed_file, 0, YARROW256_SEED_FILE_SIZE);
+  memset(ctx->counter, 0, sizeof(ctx->counter));
+  
   ctx->nsources = n;
   ctx->sources = s;
 
@@ -228,7 +233,7 @@ yarrow_slow_reseed(struct yarrow256_ctx *ctx)
   sha256_init(&ctx->pools[YARROW_SLOW]);
 
   /* Feed it into the fast pool */
-  sha256_update(&ctx->pools[YARROW_SLOW], sizeof(digest), digest);
+  sha256_update(&ctx->pools[YARROW_FAST], sizeof(digest), digest);
 
   yarrow_fast_reseed(ctx);