diff --git a/src/isaac_rand/isaac_rand.h b/src/isaac_rand/isaac_rand.h index 4931bea..21accbf 100644 --- a/src/isaac_rand/isaac_rand.h +++ b/src/isaac_rand/isaac_rand.h @@ -16,7 +16,7 @@ MODIFIED: #ifndef RAND #define RAND -#define RANDSIZL (8) /* I recommend 8 for crypto, 4 for simulations */ +#define RANDSIZL (4) /* I recommend 8 for crypto, 4 for simulations */ #define RANDSIZ (1<randrsl[0], SIZE_OF_ISAAC ); + i = i + SIZE_OF_ISAAC; + } + + /* If there is some remainder copy only relevant number of bytes to not overflow the buffer. */ + if( remain > 0 ) + { + /* get the next 32bit random number */ + isaac( isaac_state ); + + nwipe_u32tobuffer( (u8*) ( buffer + i ), isaac_state->randrsl[0], SIZE_OF_ISAAC ); + } return 0; } diff --git a/src/prng.h b/src/prng.h index fe4398b..34d152a 100644 --- a/src/prng.h +++ b/src/prng.h @@ -54,4 +54,7 @@ int nwipe_isaac_read( NWIPE_PRNG_READ_SIGNATURE ); /* Size of the twister is not derived from the architecture, but it is strictly 4 bytes */ #define SIZE_OF_TWISTER 4 +/* Size of the isaac is not derived from the architecture, but it is strictly 4 bytes */ +#define SIZE_OF_ISAAC 4 + #endif /* PRNG_H_ */ diff --git a/src/version.c b/src/version.c index 6b2aa37..ec7bc11 100644 --- a/src/version.c +++ b/src/version.c @@ -4,7 +4,7 @@ * used by configure to dynamically assign those values * to documentation files. */ -const char* version_string = "0.30.007"; +const char* version_string = "0.30.008"; const char* program_name = "nwipe"; const char* author_name = "Martijn van Brummelen"; const char* email_address = "git@brumit.nl"; @@ -14,4 +14,4 @@ Modifications to original dwipe Copyright Andy Beverley \n\ This is free software; see the source for copying conditions.\n\ There is NO warranty; not even for MERCHANTABILITY or FITNESS\n\ FOR A PARTICULAR PURPOSE.\n"; -const char* banner = "nwipe 0.30.007"; +const char* banner = "nwipe 0.30.008";