Random number generation
Décio Luiz Gazzoni Filho
decio at decpp.net
Thu Nov 3 15:07:53 CET 2005
On Nov 3, 2005, at 11:52 AM, Torbjorn Granlund wrote:
> Décio Luiz Gazzoni Filho <decio at decpp.net> writes:
>
> I know I shouldn't try to help, but I will anyway.
>
> Naughty you!
>
> ..., or perhaps read your CPU's cycle counter ...
>
> I'd like to mildy warn against that particular seeding source.
> The cycle counter typically is reset when a process is initiated,
> and while it might yield slightly different values for subsequent
> runs, it will typically only give a handful different values.
>
Really? I never noticed that -- to me this just counted the number of
cycles since the machine booted. You're talking about e.g. the RDTSC
instruction in IA-32, right?
> The current time is a better entropy source, except that it is
> not useful for cryptographic purposes.
Typically I'd use something like the time with microsecond
granularity and the cycle counter. A bit more entropy than just the
time.
Décio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://gmplib.org/list-archives/gmp-discuss/attachments/20051103/c8b8a728/PGP.bin
More information about the gmp-discuss
mailing list