-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce loadable pseudo-random number generators.
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.
- Loading branch information
Showing
50 changed files
with
10,131 additions
and
17 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
% tr.sty | ||
\gdef\@abstract{}\gdef\@trnumber{} | ||
\gdef\@affiliation{University of Idaho\\Department of Computer Science\\Moscow, ID, 83844, USA} | ||
\def\maketitle{\begin{titlepage} | ||
\let\footnotesize\small \let\footnoterule\relax \setcounter{page}{0} | ||
\null | ||
\vfil | ||
\vskip 40pt \begin{center} | ||
{\LARGE\bf \@title \par} \vskip 3em {\large \lineskip .75em | ||
{\bf \@author} | ||
\par} | ||
\vskip 1.0em {\bf Unicon Technical Report: \@trnumber}\par | ||
\vskip 1.0em {\large\bf \@date} | ||
\vskip 5.5em \par | ||
|
||
{\bf Abstract} | ||
\begin{quote} | ||
\@abstract | ||
\end{quote} | ||
\vskip 0.8in | ||
{\large\bf | ||
Unicon Project\\ | ||
http://unicon.org\\ | ||
\ \\ | ||
\@affiliation | ||
} | ||
\end{center} | ||
|
||
\@thanks | ||
\vfil | ||
\null | ||
\end{titlepage} | ||
\setcounter{footnote}{0} \let\thanks\relax | ||
\gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\maketitle\relax} | ||
\def\trnumber#1{\gdef\@trnumber{#1}} | ||
\def\abstract#1{\gdef\@abstract{#1}} | ||
\def\affiliation#1{\gdef\@affiliation{#1}} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,28 @@ | ||
Unicon Plugins - February 2017 | ||
------------------------------ | ||
|
||
This directory is home for Unicon's official shared/loadable objects and their sources. This is where some of the new experimental features are added that eventually could be moved to be part of the language, or those features that are deemed to be nonessential to be added as built-in to the language. Contributions are welcome. If you plan to contribute a new feature in the form of a shared object please follow the guidelines below as this makes it easier for us to integrate them with our build system on various platforms. | ||
This directory is home for Unicon's official shared/loadable objects and their | ||
sources. This is where some of the new experimental features are added that | ||
eventually could be moved to be part of the language, or those features that are | ||
deemed to be nonessential to be added as built-in to the language. Contributions | ||
are welcome. If you plan to contribute a new feature in the form of a shared | ||
object please follow the guidelines below as this makes it easier for us to | ||
integrate them with our build system on various platforms. | ||
|
||
1- Make sure every source file has a licence at the top | ||
2- Please use consistent formatting across your source files | ||
3- Add rules to the make file to build your shared library | ||
|
||
Note that, as of August 2019, there are now two different kinds of additional | ||
features: | ||
Conventional plugins, as before. | ||
Random Number Generator (RNG) shared libraries. | ||
|
||
The RNG libraries are implemented differently to a conventional plugin and each | ||
library is located in a separate subdirectory of plugins/rngLibraries. The | ||
simplest example is in plugins/rngLibraries/rngIconEx, which contains a | ||
re-implementation of the built-in (Icon) generator as a shared library. | ||
The "Ex" may be interpreted as "External" or "Example" (or both). | ||
|
||
Note that, for any shared RNG library to work, your implementation of Unicon | ||
must be built with the symbol RngLibrary defined. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
################################################################################ | ||
# | ||
# This file is released under the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE | ||
# (LGPL) version 2. The licence may be found in the root directory of the Unicon | ||
# source directory in the file COPYING. | ||
# | ||
################################################################################ | ||
# | ||
# Makefile for the rng shared libraries | ||
# | ||
# Don Ward | ||
# March 2021 | ||
# | ||
################################################################################ | ||
include ../../Makedefs | ||
|
||
.PHONY: Pure clean install test testPrograms | ||
|
||
TESTPROGS = rngConfidence rngPutGet rngSpeed | ||
UNILIB = $(shell unicon -features | grep "Libraries at" | sed -e "s/Libraries at //") | ||
|
||
default: all_prngs | ||
|
||
all_prngs: | ||
$(MAKE) -C rngIconEx | ||
$(MAKE) -C rngRbt | ||
|
||
test: all_prngs testPrograms | ||
$(MAKE) -C rngIconEx test | ||
$(MAKE) -C rngRbt test | ||
./rngConfidence | ||
|
||
testPrograms: $(TESTPROGS) | ||
|
||
rngConfidence: rngConfidence.icn | ||
unicon -s $^ -o $@ | ||
|
||
rngPutGet: rngPutGet.icn | ||
unicon -s $^ -o $@ | ||
|
||
rngSpeed: rngSpeed.icn | ||
unicon -s $^ -o $@ | ||
|
||
install: all_prngs | ||
# Each install places a shared library in plugins/lib (a.k.a ../lib) | ||
@$(MAKE) -C rngIconEx install | ||
@$(MAKE) -C rngRbt install | ||
# If Unicon is installed somewhere, place the shared libraries in | ||
# the installed location. | ||
@if test "X$(UNILIB)" != "X" ; then \ | ||
cp ../lib/rngIconEx.so $(UNILIB)/plugins/lib; \ | ||
cp ../lib/rngRbt.so $(UNILIB)/plugins/lib; \ | ||
fi | ||
|
||
clean: | ||
$(MAKE) -C rngIconEx clean | ||
$(MAKE) -C rngRbt clean | ||
rm -f $(TESTPROGS) | ||
|
||
Pure: | ||
$(MAKE) -C rngIconEx Pure | ||
$(MAKE) -C rngRbt Pure | ||
rm -f $(TESTPROGS) | ||
|
Oops, something went wrong.