True Random Bit Generator Using Zcdpll Based on Tms320c6416

A True Random Binary Generator (TRBG) based on a zero crossing digital phase-locked loop (ZCDPLL) is proposed. In order to face the challenges of using the proposed TRBG in cryptography, the proposed TRBG is subjected to the AIS 31 test suite. The ZCDPLL operate as chaotic generator for certain loop filter gains and this has been used to generate TRBs. The generated binary sequences have a good autocorrelation and cross-correlation properties as seen from the simulation results. A prototype of TRBG using ZCDPLL has been developed through Texas Instruments TMS320C6416 DSP development kit. The proposed TRBG successfully passed the AIS 31 test suit.


Introduction
Random and pseudo-random numbers are used in many areas including test data generation, Monte-Carlo simulation techniques, generation of spreading sequences for spread spectrum communications, and cryptography [1].Pseudo-random spreading sequences used in spread spectrum communications must be repeatable, while for most simulations using random numbers this is not necessary.In cryptographic applications, security depends on the randomness of the source and the unpredictability of the used random bits [1].
Chaotic circuits represent an efficient alternative to classical TRBG [2].Studies in nonlinear dynamics show that many of the seemingly complex systems in nature are described by relatively mathematical equations [3].Although chaotic systems appear to be highly irregular, they are also deterministic in the sense that it is possible to reproduce them with certainty.These promising features of chaotic systems attracted many researchers to try chaos as a possible medium for secure communication.
The nonlinear phenomenon of chaos poses a promising alternative for pseudo-random number generation due to its unpredictable behaviour.
The chaotic system generates "unpredictable" pseudo random orbits which can be used to generate RNGs (Random Number Generators).Many different chaotic systems have been used to generate RNGs such as Logistic map [4], and its generalized version [5], Chebyshev map, [1] piecewise linear chaotic maps [6] and piecewise nonlinear chaotic maps [7].Chaotic systems are characterized by a "sensitivity dependence on initial conditions", and with such initial uncertainties, the system behaviour leads to large uncertainty after some time.
The aim of this paper is to show how to use a second order zero crossing digital phase locked loop (ZCDPLL) operating in a chaotic mode as True Random Binary Generator (TRBG).Digital Phase locked Loops (DPLLs) were introduced to minimize some of the problems associated with the analogue loops such as sensitivity to DC drift and the need for periodic adjustments [8,9].The most commonly used DPLL is the Zero Crossing Digital Phase Locked Loop (ZCDPLL).The ZCDPLL operation is based on non uniform sampling techniques.The loop is simple to implement and easy to model.The ZCDPLL consists of a sampler that acts as phase detector, a digital filter, and a Digital Controlled Oscillator (DCO) [8]. k The global dynamics of the second order ZCDPLL shows chaos operation for certain values of filter gains [10].The non-linear behaviour of ZCDPLL shows period doubling or bifurcation instabilities to its route to chaos.The chaotic behaviour has been confirmed through the use of phase error spectrum, bifurcation diagram, and Lyapunov exponent [3,10].The proposed TRBG pass the statistical tests described by AIS 31 documents [11] However, one should notice that the statistical tests prove that the generator is an ideal random bit generator (the tests are in fact necessary but not sufficient) [12].The proposed TRBG is implemented on a Texas Instruments TMS320C6416 DSP development platform [13].
The remainder of the paper is organized as follows.In Section 2, the ZCDPLL model is presented.Random bit sequence generation using ZCDPLL is presented in Section 3. Simulation results are discussed in Section 4. Section 5 draws the conclusion.

Second Order ZCDPLL
The structure of second order ZCDPLL is shown in Figure 1.As soon as the filter finishes its operation, the stored data are transferred to the register II.The input signal to the loop is taken as x(t) = s(t) + n(t), where s(t) = Asin(ω 0 t + θ(t)), and n(t) is additive white Gaussian Noise (AWGN); θ(t) = θ 0 + Ω 0 t by which the signal dynamics are modelled; θ 0 is the initial phase which we will assume to be zero; Ω 0 is the frequency offset from the nominal value ω 0 .The input signal is sampled at time instances t k determined by the Digital Controlled Oscillator (DCO).The DCO period control algorithm is given by [14] where T 0 =(2π/ω 0 ) is the nominal period, c k-1 is the loop digital filter.The sample value of the incoming signal x(t) at t k is Or simply where s k = Asin(ω 0 t k + θ(t k ).The sequence x k is passed through a digital filter whose transfer function is D(z)s whose output ck is used to control the period of the DCO.
For noise free analysis, then The phase error is defined to be Using z-operator, equation ( 6) can be written as The control signal c k is the output of the digital filter and is formed by Substituting ( 8) into ( 7) yields In the second order ZCDPLL, the digital filter = (x, y) T then (1) can be rewritten as If the above system equation is linearized around the equilibrium points * k =0, so that sin(x* k )≈ x* k and sin (y* k ) ≈ y* k .Then (11) becomes (2 ) ( 1) Consequently the Jacobian G'(x)=∂g i /∂x is given by The loop will converge if the eigen values G'(x * ) are be less than one.Following [14] the operational regions of the second order ZCDPLL are given by (as shown in Figure 2): region (I), the loop converges locally to x * =0, 2nπ, region (II), the loop phase error  oscillates between two values, region (III), the loop phase error  oscillates between n values or diverges, while in region (IV), the loop phase error  diverges.
Fundamental to most definitions of chaos is the concept that two trajectories of the system, no matter how closely they start to one another, will eventually diverge.This divergence is of exponential order.The Lyapunov exponent is used to measure the average rate of divergence of nearby trajectories.It is defined as [3,10]: A positive Lyapunov exponent indicates chaos.The largest Lyapunov exponent for the two dimensional a dynamical ZCDPLL system is defined as [3] ' 2 ' 2 where Y' is the tangent of the direction of maximum growth which evolves according to are members of Jacobian matrix of (13).

True Random Binary Generation-TRBG
Security algorithms and protocols rely on the unpredictability of the random bits they use, True Random Binary Generators (TRBGs) play an important role in cryptographic applications [15] Classical TRBG uses some random physical phenomenon.The most frequently used phenomenon in embedded TRBGs is a jitter noise of digital clock signals [16].
Chaotic circuits represent an efficient alternative to the classical TRBGs [16,17].Contrary to traditionally used sources of randomness they use a well-defined analog deterministic circuit that exhibits chaos.Many random number generators based on analog and deterministic chaotic phenomena have been proposed, see [16,17].
To obtain random bits from ZCDPLL, the output of the sampler is monitored and assigned bit values of zero and one based on whether the output of the sampler is positive or negative as it can be seen in Figure 3. Hence, φ Є [0,π) corresponds to a "1" and φ Є[π, 2π) corresponds to a "0".
A natural source of random bits may not give unbiased bits as direct output.Many applications, especially in cryptography, rely on sequences of unbiased bits.There are various techniques to extract unbiased bits from a defective generator with unknown bias.These are called de-skewing techniques [18].These techniques also eliminate the correlation in the output of the natural sources of random bits.Von Neumann [19] proposed a digital post-processing technique that balances the distribution of bits.Post-processing converts non-overlapping pairs of bits into output bits by converting the bit pair [0,1] into an output 0, input pair [1,0] into an output 1, input pairs [1,1] and [0,0] are discarded [18].
A large number of statistical test suits have been proposed to assess the statistical properties of random number generators.A finite set of statistical tests may only detect defects in statistical properties.Furthermore, the tests cannot verify the unpredictability of the random sequence which is demanded in cryptographic applications.In this section, the proposed random bit generator is evaluated with statistical tests proposed by BSI as Applications Notes and Interpretation of the Scheme (AIS) [11].The statistical tests are applied to a bit sequence obtained after the de-skewing.A better result of the statistical test can be obtained, if a strong de-skewing technique is used such as a cryptographic hash function, but these create a long delay [18].
Although random numbers play an important role in numerous cryptographic applications, Information Technology Security Evaluation Criteria (ITSEC) [20] nor Common Criteria [21] (CC) specify any uniform evaluation criteria for random numbers.For this purpose the AIS 31 Document Standard describes some evaluation criteria for true (physical) random number generators.AIS has been effective in Germany since 2001 [11].The monobit, poker, runs, long runs, and entropy tests have been used in this paper as defined by AIS 31 document in order to test the randomness of the chaotic bits sequence generated by the ZCDPLL.

System Performance
The TRBG using ZCDPLL has been verified by simulation.A modulation free input signal x(t)= sin(ω 1 t) is considered, where ω 1 is the input frequency, and the center frequency of the DCO is assumed to be ω 0 =1 rad/sec.In order to see where the loop has chaotic behavior, Lyapunov exponent has been calculated for all possible values of the loop parameters (K 1 and r) and has been given black dot when they have values greater than 1 (positive Lyapunov represents chaotic operation).The distribution of these black dots is shown in Figure 4.In order to produce chaotic sequence of phase error, one should work in black regions.
The chaotic phase φ k distribution generated by the second order ZCDPLL distribution is shown in Figure 5 where K 1 =2.5, and r =2.5.Sample 2 is shown in Figure 6 for K 1 =3.0, and r =2.5.The two phase sequences are random.The one million bits extracted from the phase sequence of ZCDPLL have been collected (φ Є [0,π) corresponds to a "1" and φ Є [π, 2π) corresponds to a "0".The autocorrelation properties of the outputs are shown in Figure 7. Chaotic sequence have very low cross correlation as shown in Figure 8 for the two binary streams generated using two different loop parameters.This is an important issue with regard to the security, because the receiver can not be determined from a few points in the sequence.
The chaotic bit stream generated by the second order ZCDPLL of length 20000 bits is subject to each of the tests.The Monobit test is projected as evidence if the number of 1's and 0's in the sequence are nearly equal.The AIS standard specified the value of the number of 1's in the bit stream to be somewhere between 9654 and 10346.The Pocker Test requires the division of the initial sequence into 4 bit contiguous segments, the counting and the storing of each of the 16 possible 4 bit values.Denoting as f (k) the number of each value, 0 ≤ k ≤ 15, the X statistic is computed by means of (The test will pass if 1.03 ≤ X ≤ 57.4): The third test used is runs test.If we describe a run as the maximal sequence of consecutive bits of the same kind then the incidence of runs for both consecutive zeros and consecutive ones of all lengths of what between 1 and 6 in the sample stream should be in the corresponding interval as specified in Table 1.
It is worth noticing the fact that the sequences longer than 6 are considered of length 6 when counting them.The test is passed if for the generated sequence the number of consecutive bits of each length is between the limits given in the Table 2.The long run test is passed if there are no runs of length 34 or more.rate signal processing.In the realization based of DSP, variable sampling rate can be efficiently implemented using the DSP chip timer.At the beginning of the software program, the DSP timer (e.g Timer1) is set to be equal to maximum value of the sampling period.While the timer counts towards zero, an input (error) sample is read from the Analogue to Digital converter (ADC).On the basis of the error sample, the controller output and the actual value of the sampling period T are computed.Then the computed value of the sampling period is used to set the timer period.The DSP processor will enter an idle state till the timer expired, then the processed will be interrupted and the Interrupt Service Routine (ISR) will be called and the program loop repeats (see Figure 9).Real-Time Data Exchange (RTDX) is used to provide real time, continuous visibility into the way TRBG software application operates in TMS320C6416.RTDX allows transfer the random bits generated in the DSP to a host PC for testing.On the host platform, an RTDX host library operates in conjunction with Code Composer Studio.In RTDX an output channel should be configured within ZCDPLL software.The generated data from ZCDPLL is written to the output channel.This data is immediately recorded into a C6416 DSP buffer defined in the RTDX C6416 library.The data from this buffer is then sent to the host PC through the JTAG interface.The RTDX host library receives this data from the JTAG interface and records it into either a memory buffer for testing purposes.
The proposed true random bit generator successfully passes all four statistical tests for every run.Table 2 shows the results of AIS 31 Standard Statistical Tests ran over 1 million random bits generated by ZCDPLL with K 1 =2.5, r=2.5.As can be seen, all results are within the accepted range of the tests.

TMS320C6416 Implementation
The TRBG using ZCDPLL has been implemented in the software code targeted at a Texas Instruments TMS 320C6416 DSP.The generated bits are collected by the host PC.The key issue in the realization of the TRBG using ZCDPLL is the implementation of variable sample One million bits have been collected by the host PC.The same AIS 31 test suit has been used to check the truly randomness of the generated bits by the DSP kit.The results of these tests are shown in Table 3.It can be seen that the bits passed all the three proposed tests.

Conclusions
In this paper, True Random Binary Generator (TRBG) using second order ZCDPLL has been described and evaluated.The chaotic phase error produced by the ZCDPLL has been used to generate TRB.The proposed TRBG is subjected to statistical test suit AIS 31.The proposed TRBG successfully passed the tests described by AIS31 document.Another essential result of this paper is that the proposed TRBG based on ZCDPLL is implemented fully by software based on TMS320C6416 DSP kit.TRBG synchronization is still a challenging task which will be dealt within future work.Post processing is used to improve the statistical properties of the bit sequences generated by the ZCDPLL.

Figure 1 .
Figure 1.Block diagram of the second order ZCDPLL.

Figure 2 .
Figure 2. Loop behaviour as a function of $K_1$ and $r$ for second-order ZCDPLL.

Figure 3 .
Figure 3. Block diagram of the TRBG using second order ZCDPLL.

Figure 4 .
Figure 4. Largest Lyapunov Exponent of ZCDPLL -dot when it is greater than 1.0.

Figure 5 .
Figure 5. Distribution of ZCDPLL output (Sample 1) for a set of filter gain.

Figure 6 .
Figure 6.Distribution of ZCDPLL output (Sample 2) for other set of filter gain.