X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/a7a76ebd30d6af9302fa58b4acad09c465cbac78..d6fab4f6ae209afd6799a2974ce2849123965170:/rand/rand.h diff --git a/rand/rand.h b/rand/rand.h index 389526d2..3c2fa738 100644 --- a/rand/rand.h +++ b/rand/rand.h @@ -87,7 +87,8 @@ #define RAND_POOLSZ 128 /* Input pool size in bytes */ #define RAND_BUFSZ 512 /* Output buffer size in bytes */ -#define RAND_SECSZ 20 /* Secret octets in output buffer */ +#define RAND_SECSZ 32 /* Secret octets in output buffer */ +#define RAND_KEYSZ 32 /* Recommended random key size */ #define RAND_IBITS (RAND_POOLSZ * 8) #define RAND_OBITS (RAND_BUFSZ * 8) @@ -104,7 +105,7 @@ typedef struct rand_pool { octet buf[RAND_BUFSZ]; /* Random octet output buffer */ unsigned o; /* Current index into buffer */ unsigned obits; /* Number of good bits in buffer */ - rmd160_mackey k; /* Secret key for this pool */ + union { octet k[RAND_KEYSZ]; rmd160_mackey _; } k; /* Key for the pool */ const struct rand_source *s; /* System-specific noise source */ } rand_pool;