From: mdw Date: Wed, 17 Sep 1997 15:29:28 +0000 (+0000) Subject: Mix the noise from the key timings with some other environmental noise X-Git-Tag: 1.3.3~81 X-Git-Url: https://git.distorted.org.uk/~mdw/become/commitdiff_plain/b80cbed5cd59d00d18120d8fd2a6b66212d8373e Mix the noise from the key timings with some other environmental noise (obtained from `noise_acquire') for a little bit more randomness. --- diff --git a/src/keygen.c b/src/keygen.c index f1b0abe..eba38d9 100644 --- a/src/keygen.c +++ b/src/keygen.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: keygen.c,v 1.2 1997/08/04 10:24:23 mdw Exp $ + * $Id: keygen.c,v 1.3 1997/09/17 15:29:28 mdw Exp $ * * Key generation * @@ -29,6 +29,10 @@ /*----- Revision history --------------------------------------------------* * * $Log: keygen.c,v $ + * Revision 1.3 1997/09/17 15:29:28 mdw + * Mix the noise from the key timings with some other environmental noise + * (obtained from `noise_acquire') for a little bit more randomness. + * * Revision 1.2 1997/08/04 10:24:23 mdw * Sources placed under CVS control. * @@ -60,8 +64,10 @@ /* --- Local headers --- */ #include "config.h" -#include "tx.h" #include "mdwopt.h" +#include "noise.h" +#include "rand.h" +#include "tx.h" #include "utils.h" /*----- Static variables --------------------------------------------------*/ @@ -567,6 +573,14 @@ int main(int argc, char *argv[]) kg__gen(uip, sz); kg__crepair(); + /* --- Find some noise from the environment too --- */ + + rand_clear(); + noise_acquire(); + rand_add(uip, sz / 8); + rand_churn(); + rand_extract(uip, sz / 8); + /* --- Now write the number and exit --- */ D( fputs("*** ", fp); tx_putBits(uip, sz, stdout); ) @@ -574,6 +588,7 @@ int main(int argc, char *argv[]) if (file) fclose(fp); memset(uip, 0, sz / 8); /* Burn temporary buffer */ + rand_clear(); return (0); }