Introduce loadable pseudo-random number generators.#200
Open
Don-Ward wants to merge 19 commits intouniconproject:masterfrom
Open
Introduce loadable pseudo-random number generators.#200Don-Ward wants to merge 19 commits intouniconproject:masterfrom
Don-Ward wants to merge 19 commits intouniconproject:masterfrom
Conversation
f292b54 to
1bf0fdf
Compare
etherx-dev
approved these changes
Apr 13, 2021
etherx-dev
left a comment
There was a problem hiding this comment.
My head hurts... but i know that stumbling upon this project just made it worthwhile lol.
e88b1c1 to
5f062e4
Compare
c78a020 to
e8ea554
Compare
1a957f6 to
b8f887c
Compare
ed0a88d to
6be1d9d
Compare
Collaborator
Author
|
After initial feedback, it was decided to split up the PR into several smaller commits |
3372e74 to
27d1067
Compare
f0775f3 to
b60df00
Compare
Add data structures and definitions.
Add runtime routines callable by a rnglib: getRngState getInitialBits putErrorCode Add rnglib routines callable by the runtime: startRng putSeed getRandomFpt getErrorText getRandomBits -- optional getRandomInt -- optional Add new standard functions: loadrng rngbits rngbitstring rngval
Add "loadable RNGs" to &features. Add _RNG_LIBRARY to the preprocessor predefined symbols.
RngIconEx is a reimplemtation of the (Icon) built-in generator as a loadable rnglib. It serves as an example for how implement a loadable rng library.
Rabbit is a cryptographically secure random number generator from the ESTREAM project. rngRbt implements it as a loadable rng library.
rngRlx++ is a reimplementation in C of the RanLux++ generator.
rngGSL isn't a random number generator as such; it provides an interface to the generators in the GNU Scientific Library, if that is installed.
Add a new argument --enable-rnglibs to configure. Detect the presence (or otherwise) of the GNU Scientific Library.
Add a test for --enable-rnglibs
…araibeh] This is a slight rework of commit 27b385c. It is needed because the PRNG code uses unicon_getrandom() in fmisc.r as well as init.r
Also warn if endianness is unknown.
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.
N.B. The PRNG interface introduced here is subject to review and may change.
PRNGs are per-thread and may be changed with the new loadrng() standard
function. Two PRNGs are present:
IconEx A reimplementation of the traditional generator
as a loadable library.
Rabbit A cryptographically strong PRNG from the eSTREAM project.
Other PRNGs -- probably RanLux and the Mersenne Twister -- will follow.