unsigned char incomingb[HASHINPUT];
int incomingpos;
+
+ int stir_pending;
};
static struct RandPool pool;
word32 digest[HASHSIZE / sizeof(word32)];
int i, j, k;
+ /*
+ * noise_get_light will call random_add_noise, which may call
+ * back to here. Prevent recursive stirs.
+ */
+ if (pool.stir_pending)
+ return;
+ pool.stir_pending = TRUE;
+
noise_get_light(random_add_noise);
SHATransform((word32 *) pool.incoming, (word32 *) pool.incomingb);
memcpy(pool.incoming, digest, sizeof(digest));
pool.poolpos = sizeof(pool.incoming);
+
+ pool.stir_pending = FALSE;
}
void random_add_noise(void *noise, int length)