[PATCH 1/2] rndw32: use rndhw for extra random input

Jussi Kivilinna jussi.kivilinna at iki.fi
Sun Feb 2 23:29:27 CET 2020


* random/rndw32.c (_gcry_rndw32_gather_random): Use rndhw.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
---
 random/rndw32.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/random/rndw32.c b/random/rndw32.c
index b3f63d207..4a18305aa 100644
--- a/random/rndw32.c
+++ b/random/rndw32.c
@@ -816,6 +816,13 @@ _gcry_rndw32_gather_random (void (*add)(const void*, size_t,
     log_debug ("rndw32#gather_random: jent contributed extra %u bytes\n",
                (unsigned int)n);
 
+  /* Read from a hardware source. */
+  n = _gcry_rndhw_poll_slow (add, origin, -1);
+
+  if (debug_me)
+    log_debug ("rndw32#gather_random: rndhw contributed extra %u bytes\n",
+               (unsigned int)n);
+
   return 0;
 }
 




More information about the Gcrypt-devel mailing list