Re: modifying ISAAC, a pseudo-random number generator
From: Unruh (unruh-spam_at_physics.ubc.ca)
Date: 17 Nov 2005 18:41:45 GMT
I know I know. I am harping. Since you do NOT want to repeat the sequence
(see your idea about using some random input as well as the saved state)
Why oh why oh why do you not just use /dev/urandom? It is there free for
the asking and the people that designed it spent much time thinking about
issues you have not even thought about yet, never mind coded and debugged.
I would load the program, initialise it as usual and then install the saved
Note that saving pointers to memory locations is pretty useless, since
those memory locations will certainly have changed. You want to save and
restore the contents of those locations pointed to.
Mike - EMAIL IGNORED <email@example.com> writes:
>I have downloaded ISAAC. I am modifying the code for
>my purpose, but not changing the algorithm. I have
>examined the code, especiallt the C++ version, and I
>have some questions.Thanks in advance for your
> With T either uint32_t or uint64_t,
> the state consists of:
> T randcnt;
> T* randrsl;
> T* randmem;
> T randa;
> T randb;
> T randc;
> The values that are supplied for initialization are:
> T* randrsl; // vector
> T randa; // scalar
> T randb; // scalar
> T randc; // scalar
> public initialization:
> scalars are specified
> vector is set to 0
> it looks a lot like this should not be public
> scalars are set as specified
> vector is set as specified
> 1. It is not possible to set the scalars
> without providing a (possibly 0) vector.
> Is there a reason for this?
> 2. Noting that the constructor does not
> allow specification of the vector, is
> specification of the vector important
> to good performance?
> 3. Is there any guidance on how to initialize
> either the scalars or the vector?
> 4. Remembering that I intend to save restore
> from a disk file, I assume that the entire
> state as specified above is required. Is
> this correct? Is there anything that can
> be ignored to save disk time?
The amount is so small that the reading of the stuff from the disk is
probably a tiny fraction of the disk seek time. Why would it save disk
> 5. After I restore from the disk, I will not
> do any of the initialization mentioned
> above. Clearly, another constructor will
> be required to avoid the initialization.
> Is there any problem with this?
This is the problem with trying to alter in such a fundamental way a
program written with completely different assumptions in mind. Ie, you will
have to go carefully through everything to see whether there are
initialisations by assumption going on.
> 6. In some cases, after restoration, I will
> want to inject some "true randomness",
> probably using the time of occurance of
> some external event. This would probably
> be 4 or 8 bytes of information. I could
> xor or substitute some value. What value
> should I change? Should I call something,
> possibly isaac(randctx*)after the change?
Again, why are you doing this?
> 7. Just out of curiosity, how were the magic
> numbers determined?
>Thanks again for your help.