summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-11-25 16:16:43 +0100
committeremkael <emkael@tlen.pl>2017-11-25 16:16:43 +0100
commit5ca7bcc40e2195f22dcac2cf615846ae26ca0cd4 (patch)
treee0d4d77eec45521322da3539363c9932e366dcee
parentc05d5976d97869e4a981f3403732bea07985c579 (diff)
Re-seeding hash between iterations with previous outputHEADmaster
-rw-r--r--main.c5
1 files changed, 5 insertions, 0 deletions
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;
@@ -638,6 +639,10 @@ main (int argc, char *argv[])
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
*/
hashcode = RMDhash((byte *) &seed, sizeof(seed));