1 %\documentclass{article}
2 \documentclass[10pt,journal,letterpaper,compsoc]{IEEEtran}
3 \usepackage[utf8]{inputenc}
4 \usepackage[T1]{fontenc}
11 \usepackage[ruled,vlined]{algorithm2e}
13 \usepackage[standard]{ntheorem}
14 \usepackage{algorithmic}
20 % Pour mathds : les ensembles IR, IN, etc.
23 % Pour avoir des intervalles d'entiers
27 % Pour faire des sous-figures dans les figures
28 \usepackage{subfigure}
31 \newtheorem{notation}{Notation}
33 \newcommand{\X}{\mathcal{X}}
34 \newcommand{\Go}{G_{f_0}}
35 \newcommand{\B}{\mathds{B}}
36 \newcommand{\N}{\mathds{N}}
37 \newcommand{\BN}{\mathds{B}^\mathsf{N}}
42 \title{Supplementary of ``Efficient and Cryptographically Secure Generation of Chaotic Pseudorandom Numbers on GPU''}
45 \author{Jacques M. Bahi, Rapha\"{e}l Couturier, Christophe
46 Guyeux, and Pierre-Cyrille Héam\thanks{Authors in alphabetic order}}
51 \IEEEdisplaynotcompsoctitleabstractindextext
52 \IEEEpeerreviewmaketitle
57 \section{Statistical Improvements Using Chaotic Iterations}
59 \label{The generation of pseudorandom sequence}
62 Let us now explain why we have reasonable ground to believe that chaos
63 can improve statistical properties.
64 We will show in this section that chaotic properties as defined in the
65 mathematical theory of chaos are related to some statistical tests that can be found
66 in the NIST battery. Furthermore, we will check that, when mixing defective PRNGs with
67 chaotic iterations, the new generator presents better statistical properties
68 (this section summarizes and extends the work of~\cite{bfg12a:ip}).
72 \subsection{Qualitative relations between topological properties and statistical tests}
75 There are various relations between topological properties that describe an unpredictable behavior for a discrete
76 dynamical system on the one
77 hand, and statistical tests to check the randomness of a numerical sequence
78 on the other hand. These two mathematical disciplines follow a similar
79 objective in case of a recurrent sequence (to characterize an intrinsically complicated behavior for a
80 recurrent sequence), with two different but complementary approaches.
81 It is true that the following illustrative links give only qualitative arguments,
82 and proofs should be provided later to make such arguments irrefutable. However
83 they give a first understanding of the reason why we think that chaotic properties should tend
84 to improve the statistical quality of PRNGs.
86 Let us now list some of these relations between topological properties defined in the mathematical
87 theory of chaos and tests embedded into the NIST battery. %Such relations need to be further
88 %investigated, but they presently give a first illustration of a trend to search similar properties in the
89 %two following fields: mathematical chaos and statistics.
93 \item \textbf{Regularity}. As stated in Section~\ref{subsec:Devaney}, a chaotic dynamical system must
94 have an element of regularity. Depending on the chosen definition of chaos, this element can be the existence of
95 a dense orbit, the density of periodic points, etc. The key idea is that a dynamical system with no periodicity
96 is not as chaotic as a system having periodic orbits: in the first situation, we can predict something and gain a
97 knowledge about the behavior of the system, that is, it never enters into a loop. A similar importance for periodicity is emphasized in
98 the two following NIST tests~\cite{Nist10}:
100 \item \textbf{Non-overlapping Template Matching Test}. Detect generators that produce too many occurrences of a given non-periodic (aperiodic) pattern.
101 \item \textbf{Discrete Fourier Transform (Spectral) Test}. Detect periodic features (i.e., repetitive patterns that are close one to another) in the tested sequence that would indicate a deviation from the assumption of randomness.
104 \item \textbf{Transitivity}. This topological property previously introduced states that the dynamical system is intrinsically complicated: it cannot be simplified into
105 two subsystems that do not interact, as we can find in any neighborhood of any point another point whose orbit visits the whole phase space.
106 This focus on the places visited by the orbits of the dynamical system takes various nonequivalent formulations in the mathematical theory
107 of chaos, namely: transitivity, strong transitivity, total transitivity, topological mixing, and so on~\cite{bg10:ij}. A similar attention
108 is brought on the states visited during a random walk in the two tests below~\cite{Nist10}:
110 \item \textbf{Random Excursions Variant Test}. Detect deviations from the expected number of visits to various states in the random walk.
111 \item \textbf{Random Excursions Test}. Determine if the number of visits to a particular state within a cycle deviates from what one would expect for a random sequence.
114 \item \textbf{Chaos according to Li and Yorke}. Two points of the phase space $(x,y)$ define a couple of Li-Yorke when $\limsup_{n \rightarrow +\infty} d(f^{(n)}(x), f^{(n)}(y))>0$ et $\liminf_{n \rightarrow +\infty} d(f^{(n)}(x), f^{(n)}(y))=0$, meaning that their orbits always oscillate as the iterations pass. When a system is compact and contains an uncountable set of such points, it is claimed as chaotic according
115 to Li-Yorke~\cite{Li75,Ruette2001}. A similar property is regarded in the following NIST test~\cite{Nist10}.
117 \item \textbf{Runs Test}. To determine whether the number of runs of ones and zeros of various lengths is as expected for a random sequence. In particular, this test determines whether the oscillation between such zeros and ones is too fast or too slow.
119 \item \textbf{Topological entropy}. The desire to formulate an equivalency of the thermodynamics entropy
120 has emerged both in the topological and statistical fields. Once again, a similar objective has led to two different
121 rewritting of an entropy based disorder: the famous Shannon definition of entropy is approximated in the statistical approach,
122 whereas topological entropy is defined as follows:
123 $x,y \in \mathcal{X}$ are $\varepsilon-$\emph{separated in time $n$} if there exists $k \leqslant n$ such that $d\left(f^{(k)}(x),f^{(k)}(y)\right)>\varepsilon$. Then $(n,\varepsilon)-$separated sets are sets of points that are all $\varepsilon-$separated in time $n$, which
124 leads to the definition of $s_n(\varepsilon,Y)$, being the maximal cardinality of all $(n,\varepsilon)-$separated sets. Using these notations,
125 the topological entropy is defined as follows: $$h_{top}(\mathcal{X},f) = \displaystyle{\lim_{\varepsilon \rightarrow 0} \Big[ \limsup_{n \rightarrow +\infty} \dfrac{1}{n} \log s_n(\varepsilon,\mathcal{X})\Big]}.$$
126 This value measures the average exponential growth of the number of distinguishable orbit segments.
127 In this sense, it measures the complexity of the topological dynamical system, whereas
128 the Shannon approach comes to mind when defining the following test~\cite{Nist10}:
130 \item \textbf{Approximate Entropy Test}. Compare the frequency of the overlapping blocks of two consecutive/adjacent lengths ($m$ and $m+1$) against the expected result for a random sequence.
133 \item \textbf{Non-linearity, complexity}. Finally, let us remark that non-linearity and complexity are
134 not only sought in general to obtain chaos, but they are also required for randomness, as illustrated by the two tests below~\cite{Nist10}.
136 \item \textbf{Binary Matrix Rank Test}. Check for linear dependence among fixed length substrings of the original sequence.
137 \item \textbf{Linear Complexity Test}. Determine whether or not the sequence is complex enough to be considered random.
142 We have proven in our previous works~\cite{guyeux12:bc} that chaotic iterations satisfying Theorem~\ref{Th:Caractérisation des IC chaotiques} are, among other
143 things, strongly transitive, topologically mixing, chaotic as defined by Li and Yorke,
144 and that they have a topological entropy and an exponent of Lyapunov both equal to $ln(\mathsf{N})$,
145 where $\mathsf{N}$ is the size of the iterated vector.
146 These topological properties make that we are ground to believe that a generator based on chaotic
147 iterations will probably be able to pass all the existing statistical batteries for pseudorandomness like
148 the NIST one. The following subsections, in which we prove that defective generators have their
149 statistical properties improved by chaotic iterations, show that such an assumption is true.
151 \subsection{Details of some Existing Generators}
153 The list of defective PRNGs we will use
154 as inputs for the statistical tests to come is introduced here.
156 Firstly, the simple linear congruency generators (LCGs) will be used.
157 They are defined by the following recurrence:
159 x^n = (ax^{n-1} + c)~mod~m,
162 where $a$, $c$, and $x^0$ must be, among other things, non-negative and inferior to
163 $m$~\cite{LEcuyerS07}. In what follows, 2LCGs and 3LCGs refer to two (resp. three)
164 combinations of such LCGs. For further details, see~\cite{bfg12a:ip,combined_lcg}.
166 Secondly, the multiple recursive generators (MRGs) which will be used,
167 are based on a linear recurrence of order
168 $k$, modulo $m$~\cite{LEcuyerS07}:
170 x^n = (a^1x^{n-1}+~...~+a^kx^{n-k})~mod~m .
173 The combination of two MRGs (referred as 2MRGs) is also used in these experiments.
175 Generators based on linear recurrences with carry will be regarded too.
176 This family of generators includes the add-with-carry (AWC) generator, based on the recurrence:
180 x^n = (x^{n-r} + x^{n-s} + c^{n-1})~mod~m, \\
181 c^n= (x^{n-r} + x^{n-s} + c^{n-1}) / m, \end{array}\end{equation}
182 the SWB generator, having the recurrence:
186 x^n = (x^{n-r} - x^{n-s} - c^{n-1})~mod~m, \\
189 1 ~~~~~\text{if}~ (x^{i-r} - x^{i-s} - c^{i-1})<0\\
190 0 ~~~~~\text{else},\end{array} \right. \end{array}\end{equation}
191 and the SWC generator, which is based on the following recurrence:
195 x^n = (a^1x^{n-1} \oplus ~...~ \oplus a^rx^{n-r} \oplus c^{n-1}) ~ mod ~ 2^w, \\
196 c^n = (a^1x^{n-1} \oplus ~...~ \oplus a^rx^{n-r} \oplus c^{n-1}) ~ / ~ 2^w. \end{array}\end{equation}
198 Then the generalized feedback shift register (GFSR) generator has been implemented, that is:
200 x^n = x^{n-r} \oplus x^{n-k} .
205 Finally, the nonlinear inversive (INV) generator~\cite{LEcuyerS07} has been studied, which is:
212 (a^1 + a^2 / z^{n-1})~mod~m & \text{if}~ z^{n-1} \neq 0 \\
213 a^1 & \text{if}~ z^{n-1} = 0 .\end{array} \right. \end{array}\end{equation}
218 \renewcommand{\arraystretch}{1.3}
219 \caption{TestU01 Statistical Test Failures}
222 \begin{tabular}{lccccc}
224 Test name &Tests& Logistic & XORshift & ISAAC\\
225 Rabbit & 38 &21 &14 &0 \\
226 Alphabit & 17 &16 &9 &0 \\
227 Pseudo DieHARD &126 &0 &2 &0 \\
228 FIPS\_140\_2 &16 &0 &0 &0 \\
229 SmallCrush &15 &4 &5 &0 \\
230 Crush &144 &95 &57 &0 \\
231 Big Crush &160 &125 &55 &0 \\ \hline
232 Failures & &261 &146 &0 \\
240 \renewcommand{\arraystretch}{1.3}
241 \caption{TestU01 Statistical Test Failures for Old CI algorithms ($\mathsf{N}=4$)}
242 \label{TestU01 for Old CI}
244 \begin{tabular}{lcccc}
246 \multirow{3}*{Test name} & \multicolumn{4}{c}{Old CI}\\
247 &Logistic& XORshift& ISAAC&ISAAC \\
249 &Logistic& XORshift& XORshift&ISAAC \\ \cmidrule(r){2-5}
250 Rabbit &7 &2 &0 &0 \\
251 Alphabit & 3 &0 &0 &0 \\
252 DieHARD &0 &0 &0 &0 \\
253 FIPS\_140\_2 &0 &0 &0 &0 \\
254 SmallCrush &2 &0 &0 &0 \\
255 Crush &47 &4 &0 &0 \\
256 Big Crush &79 &3 &0 &0 \\ \hline
257 Failures &138 &9 &0 &0 \\
266 \subsection{Statistical tests}
267 \label{Security analysis}
269 Three batteries of tests are reputed and regularly used
270 to evaluate the statistical properties of newly designed pseudorandom
271 number generators. These batteries are named DieHard~\cite{Marsaglia1996},
272 the NIST suite~\cite{ANDREW2008}, and the most stringent one called
273 TestU01~\cite{LEcuyerS07}, which encompasses the two other batteries.
277 \label{Results and discussion}
279 \renewcommand{\arraystretch}{1.3}
280 \caption{NIST and DieHARD tests suite passing rates for PRNGs without CI}
281 \label{NIST and DieHARD tests suite passing rate the for PRNGs without CI}
283 \begin{tabular}{|l||c|c|c|c|c|c|c|c|c|c|}
285 Types of PRNGs & \multicolumn{2}{c|}{Linear PRNGs} & \multicolumn{4}{c|}{Lagged PRNGs} & \multicolumn{1}{c|}{ICG PRNGs} & \multicolumn{3}{c|}{Mixed PRNGs}\\ \hline
286 \backslashbox{\textbf{$Tests$}} {\textbf{$PRNG$}} & LCG& MRG& AWC & SWB & SWC & GFSR & INV & LCG2& LCG3& MRG2 \\ \hline
287 NIST & 11/15 & 14/15 &\textbf{15/15} & \textbf{15/15} & 14/15 & 14/15 & 14/15 & 14/15& 14/15& 14/15 \\ \hline
288 DieHARD & 16/18 & 16/18 & 15/18 & 16/18 & \textbf{18/18} & 16/18 & 16/18 & 16/18& 16/18& 16/18\\ \hline
292 Table~\ref{NIST and DieHARD tests suite passing rate the for PRNGs without CI} shows the
293 results on the two first batteries recalled above, indicating that all the PRNGs presented
294 in the previous section
295 cannot pass all these tests. In other words, the statistical quality of these PRNGs cannot
296 fulfill the up-to-date standards presented previously. We have shown in~\cite{bfg12a:ip} that the use of chaotic
297 iterations can solve this issue.
299 %illustrate the effects of chaotic iterations on these defective PRNGs, experiments have been divided in three parts~\cite{bfg12a:ip}:
301 % \item \textbf{Single CIPRNG}: The PRNGs involved in CI computing are of the same category.
302 % \item \textbf{Mixed CIPRNG}: Two different types of PRNGs are mixed during the chaotic iterations process.
303 % \item \textbf{Multiple CIPRNG}: The generator is obtained by repeating the composition of the iteration function as follows: $x^0\in \mathds{B}^{\mathsf{N}}$, and $\forall n\in \mathds{N}^{\ast },\forall i\in \llbracket1;\mathsf{N}\rrbracket, x_i^n=$
308 %x_i^{n-1}~~~~~\text{if}~S^n\neq i \\
309 %\forall j\in \llbracket1;\mathsf{m}\rrbracket,f^m(x^{n-1})_{S^{nm+j}}~\text{if}~S^{nm+j}=i.\end{array} \right. \end{array}
311 %$m$ is called the \emph{functional power}.
314 The obtained results are reproduced in Table
315 \ref{NIST and DieHARD tests suite passing rate the for single CIPRNGs}.
316 The scores written in boldface indicate that all the tests have been passed successfully, whereas an
317 asterisk ``*'' means that the considered passing rate has been improved.
318 The improvements are obvious for both the ``Old CI'' and the ``New CI'' generators.
319 Concerning the ``Xor CI PRNG'', the score is less spectacular. Because of a large speed improvement, the statistics
320 are not as good as for the two other versions of these CIPRNGs.
321 However 8 tests have been improved (with no deflation for the other results).
325 \renewcommand{\arraystretch}{1.3}
326 \caption{NIST and DieHARD tests suite passing rates for PRNGs with CI}
327 \label{NIST and DieHARD tests suite passing rate the for single CIPRNGs}
329 \begin{tabular}{|l||c|c|c|c|c|c|c|c|c|c|c|c|}
331 Types of PRNGs & \multicolumn{2}{c|}{Linear PRNGs} & \multicolumn{4}{c|}{Lagged PRNGs} & \multicolumn{1}{c|}{ICG PRNGs} & \multicolumn{3}{c|}{Mixed PRNGs}\\ \hline
332 \backslashbox{\textbf{$Tests$}} {\textbf{$Single~CIPRNG$}} & LCG & MRG & AWC & SWB & SWC & GFSR & INV& LCG2 & LCG3& MRG2 \\ \hline\hline
333 Old CIPRNG\\ \hline \hline
334 NIST & \textbf{15/15} * & \textbf{15/15} * & \textbf{15/15} & \textbf{15/15} & \textbf{15/15} * & \textbf{15/15} * & \textbf{15/15} *& \textbf{15/15} * & \textbf{15/15} * & \textbf{15/15} \\ \hline
335 DieHARD & \textbf{18/18} * & \textbf{18/18} * & \textbf{18/18} * & \textbf{18/18} * & \textbf{18/18} & \textbf{18/18} * & \textbf{18/18} *& \textbf{18/18} * & \textbf{18/18} *& \textbf{18/18} * \\ \hline
336 New CIPRNG\\ \hline \hline
337 NIST & \textbf{15/15} * & \textbf{15/15} * & \textbf{15/15} & \textbf{15/15} & \textbf{15/15} * & \textbf{15/15} * & \textbf{15/15} *& \textbf{15/15} * & \textbf{15/15} * & \textbf{15/15} \\ \hline
338 DieHARD & \textbf{18/18} * & \textbf{18/18} * & \textbf{18/18} * & \textbf{18/18} * & \textbf{18/18} & \textbf{18/18} * & \textbf{18/18} * & \textbf{18/18} * & \textbf{18/18} *& \textbf{18/18} *\\ \hline
339 Xor CIPRNG\\ \hline\hline
340 NIST & 14/15*& \textbf{15/15} * & \textbf{15/15} & \textbf{15/15} & 14/15 & \textbf{15/15} * & 14/15& \textbf{15/15} * & \textbf{15/15} *& \textbf{15/15} \\ \hline
341 DieHARD & 16/18 & 16/18 & 17/18* & \textbf{18/18} * & \textbf{18/18} & \textbf{18/18} * & 16/18 & 16/18 & 16/18& 16/18\\ \hline
346 We have then investigated in~\cite{bfg12a:ip} if it were possible to improve
347 the statistical behavior of the Xor CI version by combining more than one
348 $\oplus$ operation. Results are summarized in Table~\ref{threshold}, illustrating
349 the progressive increasing effects of chaotic iterations, when giving time to chaos to get settled in.
350 Thus rapid and perfect PRNGs, regarding the NIST and DieHARD batteries, can be obtained
351 using chaotic iterations on defective generators.
354 \renewcommand{\arraystretch}{1.3}
355 \caption{Number of $\oplus$ operations to pass the whole NIST and DieHARD batteries}
358 \begin{tabular}{|l||c|c|c|c|c|c|c|c|}
360 Inputted $PRNG$ & LCG & MRG & SWC & GFSR & INV& LCG2 & LCG3 & MRG2 \\ \hline\hline
361 Threshold value $m$& 19 & 7 & 2& 1 & 11& 9& 3& 4\\ \hline\hline
365 Finally, the TestU01 battery has been launched on three well-known generators
366 (a logistic map, a simple XORshift, and the cryptographically secure ISAAC,
367 see Table~\ref{TestU011}). These results can be compared with
368 Table~\ref{TestU01 for Old CI}, which gives the scores obtained by the
369 Old CI PRNG that has received these generators.
370 The obvious improvement speaks for itself, and together with the other
371 results recalled in this section, it reinforces the opinion that a strong
372 correlation between topological properties and statistical behavior exists.
375 The next subsection will now give a concrete original implementation of the Xor CI PRNG, the
376 fastest generator in the chaotic iteration based family. In the remainder,
377 this generator will be simply referred to as CIPRNG, or ``the proposed PRNG'', if this statement does not
383 \bibliographystyle{plain}
384 \bibliography{mabase}