Re: [sqlite] Obtaining randomness on win32

2007-01-31 Thread Dan Kennedy
On Wed, 2007-01-31 at 20:04 -0600, Jay Sprenkle wrote: > On 1/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > Please pick a pseudo algorithm of your choice and give us the ability to > > > seed it? > > > > > > > You already have this capability. Use the redefinably I/O feature > > to

Re: [sqlite] Obtaining randomness on win32

2007-01-31 Thread drh
"Jay Sprenkle" <[EMAIL PROTECTED]> wrote: > On 1/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > Please pick a pseudo algorithm of your choice and give us the ability to > > > seed it? > > > > > > > You already have this capability. Use the redefinably I/O feature > > to insert your

Re: [sqlite] Obtaining randomness on win32

2007-01-31 Thread Jay Sprenkle
On 1/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Please pick a pseudo algorithm of your choice and give us the ability to > seed it? > You already have this capability. Use the redefinably I/O feature to insert your own random number seeder in place of the one that comes built in.

Re: [sqlite] Obtaining randomness on win32

2007-01-31 Thread drh
"Jay Sprenkle" <[EMAIL PROTECTED]> wrote: > On 1/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > The pseudo-random number generator (PRNG) in SQLite is becoming more > > important so it seem good to make sure it is well seeded. > > > I'd like to be able to seed the random number gener

Re: [sqlite] Obtaining randomness on win32

2007-01-31 Thread Jay Sprenkle
On 1/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: The pseudo-random number generator (PRNG) in SQLite is becoming more important so it seem good to make sure it is well seeded. I'd like to be able to seed the random number generator so I can have repeatable sequences of random numbers

Re: [sqlite] Obtaining randomness on win32

2007-01-30 Thread Roger Binns
John Stanton wrote: > This might help with Win32. > http://msdn2.microsoft.com/en-us/library/aa387694.aspx That function is only available on Vista, but it includes a pointer to CryptGenRandom which is on all Windows versions including Windows CE - CE doc at http://msdn2.microsoft.com/en-us/librar

Re: [sqlite] Obtaining randomness on win32

2007-01-29 Thread drh
Marco Bambini <[EMAIL PROTECTED]> wrote: > I really think that this article > http://eternallyconfuzzled.com/arts/jsw_art_rand.aspx > worths a read. > > It talks about the general rand function and the problem of > distribution... SQLite has always used an RC4-based PRNG, not rand(), for exactl

AW: [sqlite] Obtaining randomness on win32

2007-01-29 Thread Christian Schwarz
> randomness as you need. But I do not know how to do this on > win32 and wince. The current implementation seeds the random As Michael already suggested, you should use the CryptoAPI (CryptAquireContext, CryptGenRandom). This API is supported by all 32 bit desktop versions and by Windows CE sta

Re: [sqlite] Obtaining randomness on win32

2007-01-29 Thread drh
John Stanton <[EMAIL PROTECTED]> wrote: > Have you considered an option where the user can supply the seed so that > an application can implement a complete sequence from the pseudo random > number generator? > When testing (-DSQLITE_TEST=1) the seed is always 256 bytes of 0x00. That way the

Re: [sqlite] Obtaining randomness on win32

2007-01-29 Thread Nuno Lucas
On 1/29/07, Michael Ruck <[EMAIL PROTECTED]> wrote: On Windows itself you could use the CryptAcquireContext, CryptGenRandom and CryptReleaseContext. I think that doesn't work on WinCE though. It will work on Windows CE since version 2.10, as long as the OS was built with support for it (for tho

Re: [sqlite] Obtaining randomness on win32

2007-01-29 Thread Marco Bambini
I really think that this article http://eternallyconfuzzled.com/arts/jsw_art_rand.aspx worths a read. It talks about the general rand function and the problem of distribution... --- Marco Bambini http://www.sqlabs.net http://www.sqlabs.net/blog/ http://www.sqlabs.net/realsqlserver/ On Jan 2

Re: [sqlite] Obtaining randomness on win32

2007-01-29 Thread John Stanton
Have you considered an option where the user can supply the seed so that an application can implement a complete sequence from the pseudo random number generator? This might help with Win32. http://msdn2.microsoft.com/en-us/library/aa387694.aspx [EMAIL PROTECTED] wrote: The pseudo-random nu

AW: [sqlite] Obtaining randomness on win32

2007-01-29 Thread Michael Ruck
tGenRandom and CryptReleaseContext. I think that doesn't work on WinCE though. Michael > -Ursprüngliche Nachricht- > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Gesendet: Montag, 29. Januar 2007 17:15 > An: sqlite-users@sqlite.org > Betreff: [sqlite] Obtainin

[sqlite] Obtaining randomness on win32

2007-01-29 Thread drh
The pseudo-random number generator (PRNG) in SQLite is becoming more important so it seem good to make sure it is well seeded. On Unix this is easy - just open /dev/urandom and read out as much randomness as you need. But I do not know how to do this on win32 and wince. The current implementatio