1libdieharder(3)            Library Functions Manual            libdieharder(3)
2
3
4

NAME

6       libdieharder  -  A  testing  and benchmarking library for random number
7       generators
8
9

SYNOPSIS

11       #include dieharder.h
12
13       void run_user_template()
14       {
15
16       Test **user_template_test;
17       /*
18        * Create the test
19        */
20       user_template_test  =   create_test(&user_template_dtest,tsamples,psam‐
21       ples,&user_template);
22
23       /*
24        * Set any GLOBAL data used by the test.
25        */
26       user_template_lag = (int)x_user;
27
28       /*
29        * Show the standard test header
30        */
31       show_test_header(&user_template_dtest,user_template_test);
32
33       /*
34        * Call the test
35        */
36       std_test(&user_template_dtest,user_template_test);
37
38       /*
39        * This almost certainly belongs in the show_test_results section,
40        * possibly with additional conditionals rejecting test results involv‐
41       ing
42        * rewinds, period.
43        */
44       if(strncmp(
45             printf(     #     %u     rands     were     used     in      this
46       test0,file_input_get_rtot(rng));"
47              printf(     #     The     file     %s     was     rewound     %u
48       times0,gsl_rng_name(rng),file_input_get_rewind_cnt(rng));"
49       }
50
51       /*
52        * Show standard test results
53        */ .
54       show_test_results(&user_template_dtest,user_template_test);
55
56       }
57
58
59

DESCRIPTION

61       libdieharder
62
63       The libdieharder library provides an API  to  user  interface  programs
64       wishing  to  call  dieharder  tests.  Commands are defined for creating
65       tests, initializing the tests  and  running  the  tests.   Showing  the
66       results is of course the responsibility of the UI.
67
68       libdieharder  also wraps certain additional random number generators so
69       that they can be tested.  libdieharder can be default test all the ran‐
70       dom  number  generators  in the Gnu Scientific Library plus these addi‐
71       tional generators (which include "generators" for  reading  in  numbers
72       from a file).
73
74       libdieharder  is  extensible.  It is fairly easy to add additional test
75       "objects" or random number generators using existing  sources  as  tem‐
76       plates.
77
78       The  API  will  be  documented in more detail as the project approaches
79       completion.  In the meantime, it is  strongly  recommended  that  users
80       wishing to call the library use the source of the dieharder tty UI as a
81       template and list of all currently supported objects, as  this  is  the
82       primary libdieharder debugging vehicle in addition to being the current
83       "standard" application of the library.
84
85

PUBLICATION RULES

87       libdieharder is entirely original code and can be modified and used  at
88       will by any user, provided that:
89
90         a) The original copyright notices are maintained and that the source,
91       including all modifications, is made publically available at  the  time
92       of  any derived publication.  This is open source software according to
93       the precepts and spirit of the Gnu Public License.  See the  accompany‐
94       ing file COPYING, which also must accompany any redistribution.
95
96         b) The author of the code (Robert G. Brown) is appropriately acknowl‐
97       edged and referenced in any derived publication.  It is  strongly  sug‐
98       gested  that  George  Marsaglia  and  the Diehard suite and the various
99       authors of  the  Statistical  Test  Suite  be  similarly  acknowledged,
100       although this suite shares no actual code with these random number test
101       suites.
102
103         c) Full responsibility for the accuracy, suitability, and  effective‐
104       ness  of  the  program  rests  with  the users and/or modifiers.  As is
105       clearly stated in the accompanying copyright.h:
106
107       THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFT‐
108       WARE,  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
109       IN NO EVENT SHALL THE COPYRIGHT HOLDERS  BE  LIABLE  FOR  ANY  SPECIAL,
110       INDIRECT  OR  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
111       FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN  ACTION  OF  CONTRACT,
112       NEGLIGENCE  OR  OTHER  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
113       WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
114
115

ACKNOWLEDGEMENTS

117       The author of this suite gratefully acknowledges George Marsaglia  (the
118       author  of the diehard test suite) and the various authors of NIST Spe‐
119       cial Publication 800-22 (which describes the Statistical Test Suite for
120       testing pseudorandom number generators for cryptographic applications),
121       for excellent descriptions of the tests  therein.   These  descriptions
122       enabled  this  suite to be developed with a clean copyright, licensable
123       under the GPL.
124
125       The author also wishes to reiterate that the academic  correctness  and
126       accuracy  of the implementation of these tests is his sole responsibil‐
127       ity and not that of the authors of the Diehard or STS suites.  This  is
128       especially  true where he has seen fit to modify those tests from their
129       strict original descriptions.
130
131
133       GPL 2b; see the file COPYING that accompanies the source of  this  pro‐
134       gram.   This  is  the "standard Gnu General Public License version 2 or
135       any later version", with the one minor (humorous) "Beverage"  modifica‐
136       tion listed below.  Note that this modification is probably not legally
137       defensible and can be followed really  pretty  much  according  to  the
138       honor rule.
139
140       As  to my personal preferences in beverages, red wine is great, beer is
141       delightful, and Coca Cola or coffee or tea or even milk  acceptable  to
142       those  who for religious or personal reasons wish to avoid stressing my
143       liver.
144
145       The Beverage Modification to the GPL:
146
147       Any satisfied user of this software shall,  upon  meeting  the  primary
148       author(s)  of  this  software  for the first time under the appropriate
149       circumstances, offer to buy him or her or them a beverage.  This bever‐
150       age  may or may not be alcoholic, depending on the personal ethical and
151       moral views of the offerer.  The beverage cost need not exceed one U.S.
152       dollar (although it certainly may at the whim of the offerer:-) and may
153       be accepted or declined with no further obligation on the part  of  the
154       offerer.  It is not necessary to repeat the offer after the first meet‐
155       ing, but it can't hurt...
156
157
158
159
160libdieharder            Copyright 2006 Robert G. Brown         libdieharder(3)
Impressum