diff options
author | Niels Möller <nisse@lysator.liu.se> | 2001-10-08 22:46:54 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2001-10-08 22:46:54 +0200 |
commit | 069e016707f1380925490c809ab7802c25d8f29d (patch) | |
tree | 3daa6098826e37f23e65d5755e0e26133a455598 /yarrow256.c | |
parent | 9ddbf3553b1288fefc2b8cf3d20e15c46de598d2 (diff) | |
download | nettle-069e016707f1380925490c809ab7802c25d8f29d.tar.gz |
* yarrow256.c (yarrow_fast_reseed): Generate two block of output
using the old key and feed into the pool.
Rev: src/nettle/yarrow256.c:1.6
Diffstat (limited to 'yarrow256.c')
-rw-r--r-- | yarrow256.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/yarrow256.c b/yarrow256.c index 0db78184..3e72278a 100644 --- a/yarrow256.c +++ b/yarrow256.c @@ -70,10 +70,19 @@ static void yarrow_fast_reseed(struct yarrow256_ctx *ctx) { uint8_t digest[SHA256_DIGEST_SIZE]; - unsigned i; - /* FIXME: Mixin the current key! */ + /* We feed two block of output using the current key into the pool + * before emptying it. */ + if (ctx->seeded) + { + uint8_t blocks[AES_BLOCK_SIZE * 2]; + + yarrow_generate_block(ctx, blocks); + yarrow_generate_block(ctx, blocks + AES_BLOCK_SIZE); + sha256_update(&ctx->pools[YARROW_FAST], sizeof(blocks), blocks); + } + sha256_final(&ctx->pools[YARROW_FAST]); sha256_digest(&ctx->pools[YARROW_FAST], sizeof(digest), digest); sha256_init(&ctx->pools[YARROW_FAST]); |