X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/0f00dc4c8eb47e67bc0f148c2dd109f73a451e0a..d6fab4f6ae209afd6799a2974ce2849123965170:/rand/rand.h diff --git a/rand/rand.h b/rand/rand.h index a024c0f4..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; @@ -290,7 +291,11 @@ enum { /* --- Default random number generator --- */ -extern grand rand_global; +#ifdef RAND__HACKS + extern struct rand__gctx rand_global; +#else + extern grand rand_global; +#endif /* --- @rand_create@ --- * *