}
return (65535 + dist[to >> 16] - dist[from >> 16]) % 65535;
}
+/** validate_prng_nonce
+ * Determine if nonce is deterministic. ie: Suspectable to Darkside attack.
+ * returns
+ * true = weak prng
+ * false = hardend prng
+ */
+bool validate_prng_nonce(uint32_t nonce) {
+ // init prng table:
+ nonce_distance(nonce, nonce);
+ return ((65535 - dist[nonce >> 16] + dist[nonce & 0xffff]) % 65535) == 16;
+}
static uint32_t fastfwd[2][8] = {