Commit 92fa8bbe authored by Niels Möller's avatar Niels Möller

(yarrow_key_event_estimate): Check if

previous is zero.
(yarrow_key_event_init): Initialize previous to zero.

Rev: src/nettle/yarrow_key_event.c:1.2
parent b2a6b03a
......@@ -30,6 +30,8 @@ yarrow_key_event_init(struct yarrow_key_event_ctx *ctx)
unsigned i;
ctx->index = 0;
ctx->previous = 0;
for (i = 0; i < YARROW_KEY_EVENT_BUFFER; i++)
ctx->chars[i] = 0;
}
......@@ -42,7 +44,7 @@ yarrow_key_event_estimate(struct yarrow_key_event_ctx *ctx,
unsigned i;
/* Look at timing first. */
if (ctx->index)
if (ctx->previous)
{
if ( (time - ctx->previous) < 256)
entropy++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment