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

(yarrow256_fast_reseed): Set ctx->seeded = 1, so

that it is set if and only if the aes context has been initialized
with aes_set_encrypt_key.
(yarrow256_seed): No need to set ctx->seeded here.
(yarrow256_update): Likewise.

Rev: nettle/ChangeLog:1.28
Rev: nettle/yarrow256.c:1.5
parent a2dc0c30
No related branches found
No related tags found
No related merge requests found
2008-11-22 Niels Mller <nisse@lysator.liu.se>
* yarrow256.c (yarrow256_fast_reseed): Set ctx->seeded = 1, so
that it is set if and only if the aes context has been initialized
with aes_set_encrypt_key.
(yarrow256_seed): No need to set ctx->seeded here.
(yarrow256_update): Likewise.
2008-11-04 Niels Mller <nisse@lysator.liu.se> 2008-11-04 Niels Mller <nisse@lysator.liu.se>
* examples/next-prime.c (main): Avoid using gmp_fprintf, to stay * examples/next-prime.c (main): Avoid using gmp_fprintf, to stay
......
...@@ -108,8 +108,6 @@ yarrow256_seed(struct yarrow256_ctx *ctx, ...@@ -108,8 +108,6 @@ yarrow256_seed(struct yarrow256_ctx *ctx,
sha256_update(&ctx->pools[YARROW_FAST], length, seed_file); sha256_update(&ctx->pools[YARROW_FAST], length, seed_file);
yarrow256_fast_reseed(ctx); yarrow256_fast_reseed(ctx);
ctx->seeded = 1;
} }
/* FIXME: Generalize so that it generates a few more blocks at a /* FIXME: Generalize so that it generates a few more blocks at a
...@@ -193,6 +191,7 @@ yarrow256_fast_reseed(struct yarrow256_ctx *ctx) ...@@ -193,6 +191,7 @@ yarrow256_fast_reseed(struct yarrow256_ctx *ctx)
yarrow_iterate(digest); yarrow_iterate(digest);
aes_set_encrypt_key(&ctx->key, sizeof(digest), digest); aes_set_encrypt_key(&ctx->key, sizeof(digest), digest);
ctx->seeded = 1;
/* Derive new counter value */ /* Derive new counter value */
memset(ctx->counter, 0, sizeof(ctx->counter)); memset(ctx->counter, 0, sizeof(ctx->counter));
...@@ -294,8 +293,6 @@ yarrow256_update(struct yarrow256_ctx *ctx, ...@@ -294,8 +293,6 @@ yarrow256_update(struct yarrow256_ctx *ctx,
if (!yarrow256_needed_sources(ctx)) if (!yarrow256_needed_sources(ctx))
{ {
yarrow256_slow_reseed(ctx); yarrow256_slow_reseed(ctx);
ctx->seeded = 1;
return 1; return 1;
} }
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment