From 5ca7bcc40e2195f22dcac2cf615846ae26ca0cd4 Mon Sep 17 00:00:00 2001 From: emkael Date: Sat, 25 Nov 2017 16:16:43 +0100 Subject: Re-seeding hash between iterations with previous output --- main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.c b/main.c index fe63404..712e1c0 100644 --- a/main.c +++ b/main.c @@ -426,6 +426,7 @@ hexdump(byte *input, int len) { static struct { byte seed_sequence[4]; /* sequence number in PRNG sequence */ byte seed_random[RMDbytes]; /* 160 bits collected at start */ + byte seed_previous[RMDbytes]; /* 160 bits from previous iteration */ byte seed_owner[RMDbytes]; /* 160 bit hash of owner ident */ } seed; @@ -637,6 +638,10 @@ main (int argc, char *argv[]) seed.seed_sequence[1] = (seqno>>8) & 0xFF; seed.seed_sequence[2] = (seqno>>16) & 0xFF; seed.seed_sequence[3] = (seqno>>24) & 0xFF; + /* + * Seed the next iteration with the current output + */ + memcpy(seed.seed_previous, hashcode, RMDbytes); /* * Run all the bits through the hash */ -- cgit v1.2.3