Conversation
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.
Owner
Author
|
My mistake. Feel free to delete this PR altogether. |
Owner
|
No problem :-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.