Skip to content

Add os random prng glv2 - #3

Closed
eadmund wants to merge 13 commits into
glv2:masterfrom
eadmund:add-os-random-prng-glv2
Closed

eadmund wants to merge 13 commits into
glv2:masterfrom
eadmund:add-os-random-prng-glv2

Conversation

@eadmund

@eadmund eadmund commented Jun 26, 2017

Copy link
Copy Markdown

Since froydnj/ironclad is no longer supported and glv2's appears to be the new canonical repo recognised by Quicklisp, I'm requesting that my PRNG overhaul be merged in.

C.f. froydnj#82 for detailed explanation of changes.

Robert A. Uhl and others added 13 commits January 24, 2017 18:51
There are now three different PRNG classes: the default OS-provided
PRNG (/dev/urandom on Unix & CryptGenRandom on Windows); the Fortuna
PRNG & the Fortuna generator.  Almost every single Ironclad user
should just use the default OS-provided PRNG; if one wishes to have a
userspace PRNG (which is generally considered to be a Bad Idea™) then
one might wish to use the Fortuna PRNG.  Finally, the Fortuna
generator can be used as a seeded, predictable PRNG, perhaps for use
with Monte Carlo simulations in need of high-quality random-like data.
Do _not_ use the Fortuna generator on its own to generate key
material!

The API has been simplified: rather than the previous plethora of
INTERNAL- methods, there is now a single mandatory
method (PRNG-RANDOM-DATA) and two optional methods: PRNG-RESEED &
PRNG-SEED-LENGTH.

Overlong parameter names have been shortened.  Internal names have
been disambiguated (e.g. POOL → FORTUNA-POOL).  The source has been
reorganised.
Once corrections were made, the generator test vector worked
perfectly.

The Fortuna test vectors had incorrectly-sized seeds; after switching
to properly-sized seeds, I updated the test vectors.

I also updated MAKE-PRNG to not assume that it's making a Fortuna
PRNG.

Finally, the tests always passed, due to RT requiring an error vice a
nil; this is now corrected.
It's better to use the OS-provided PRNG.
Tested the existing SBCL support.

Implemented & tested support for Clozure Common Lisp, Allegro Common
Lisp & LispWorks.  These all use RtlGenRandom.
@glv2

glv2 commented Jun 26, 2017

Copy link
Copy Markdown
Owner

I already merged your PRNG overhaul in my branch a while ago to use it (commits from b4c8215 to 9cfb221).

@eadmund

eadmund commented Jun 26, 2017

Copy link
Copy Markdown
Author

My mistake. Feel free to delete this PR altogether.

@eadmund eadmund closed this Jun 26, 2017
@glv2

glv2 commented Jun 26, 2017

Copy link
Copy Markdown
Owner

No problem :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants