30.01.2013 Views

november 2010 volume 1 number 2 - Advances in Electronics and ...

november 2010 volume 1 number 2 - Advances in Electronics and ...

november 2010 volume 1 number 2 - Advances in Electronics and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

52 ADVANCES IN ELECTRONICS AND TELECOMMUNICATIONS, VOL. 1, NO. 2, NOVEMBER <strong>2010</strong><br />

result of all tests from the NIST test suite, we must use<br />

many source generators, which is numerically <strong>in</strong>efficient. In<br />

this section, we <strong>in</strong>troduce a new method for generat<strong>in</strong>g many<br />

source streams by a s<strong>in</strong>gle MCPG. The generator is derived<br />

from the sawtooth chaotic map implemented <strong>in</strong> a f<strong>in</strong>ite-state<br />

mach<strong>in</strong>e <strong>in</strong> the modular arithmetic. The benefit is that we can<br />

comb<strong>in</strong>e many source streams <strong>in</strong>to a s<strong>in</strong>gle sequence without<br />

significantly decreas<strong>in</strong>g the speed of produc<strong>in</strong>g pseudor<strong>and</strong>om<br />

<strong>number</strong>s.<br />

Let Sλ denotethesawtoothmap,namedalsotheRényimap,<br />

the Bernoulli shift, or the Bernoulli map. Map Sλ transforms<br />

the unit <strong>in</strong>terval I = [0, 1) ⊂ X, X ≡ R <strong>in</strong>to itself <strong>and</strong> has<br />

the follow<strong>in</strong>g form<br />

Sλ(x) = λx mod 1, (2)<br />

where λ is a real <strong>number</strong>. Comput<strong>in</strong>g successive values of<br />

expression<br />

sn = ⌊αxn⌋ , α ≥ 2 , n = 1, 2, ..., (3)<br />

where α is an <strong>in</strong>teger <strong>and</strong> xn = λxn−1 mod 1, we obta<strong>in</strong><br />

a sequence {sn} of <strong>in</strong>teger <strong>number</strong>s. Numbers sn can be<br />

regardedas <strong>in</strong>dices of sub<strong>in</strong>tervalsconta<strong>in</strong><strong>in</strong>g xn <strong>and</strong> obta<strong>in</strong>ed<br />

as the result of partition<strong>in</strong>g I <strong>in</strong>to α disjo<strong>in</strong>t, equal-sized<br />

sub<strong>in</strong>tervals Ij, j = 0, 1, 2, ..., α − 1, cover<strong>in</strong>g the whole<br />

set I. Through assign<strong>in</strong>g a unique <strong>number</strong> (symbol) from<br />

set Aα = {0, 1, ..., α − 1} to every Ij, the macroscopic<br />

behavior of the dynamical system (Sλ, I) can be studied.<br />

This macroscopic dynamics is called symbolic dynamics. It is<br />

knownthatsymbolicsequencesmaybetreatedastrulyr<strong>and</strong>om<br />

sequences <strong>in</strong> many aspects [7]–[10]. Assum<strong>in</strong>g <strong>in</strong>teger λ <strong>and</strong><br />

rational x0 = (p0)/(q0), where 0 < pn < q0, we obta<strong>in</strong> that<br />

[11] ⎧ ⎨<br />

⎩<br />

sn = ⌊αxn⌋<br />

xn = pn<br />

q0<br />

pn = λ · pn−1 mod q0<br />

n = 1, 2, . . .<br />

. (4)<br />

Because <strong>in</strong> a f<strong>in</strong>ite-state mach<strong>in</strong>e the <strong>number</strong> of bits encod<strong>in</strong>g<br />

the values of all variables is limited to l, where l is f<strong>in</strong>ite,<br />

expression (4) can be written as<br />

⎧<br />

⎪⎨ sn = ⌊α · xn⌋ � �<br />

pn<br />

xn = truncl n = 1, 2, . . . , (5)<br />

q0<br />

⎪⎩<br />

pn = λpn−1 mod q0<br />

where truncl denotes the truncation operation, leav<strong>in</strong>g l the<br />

most significant bits of quotient (pn)/(q0). If α = 2k , 1 ≤<br />

k ≤ l, then sequence {sn} consists of <strong>number</strong>s encoded by<br />

the k most significant bits of xn. If additionally q0 = 2l or<br />

q0 = 2l − 1, these bits are the same as the most significant<br />

bits of pn (see [11] for examples). Then (5) is reduced to<br />

�<br />

sn = trunck(pn)<br />

. (6)<br />

pn = λpn−1 mod q0<br />

The second formula <strong>in</strong> (6) describes the multiplicative congruential<br />

pseudor<strong>and</strong>om generator (1) with a = λ <strong>and</strong> b = q0.<br />

For α = 2 k , 1 ≤ k ≤ l <strong>and</strong> q0 = 2 l or q0 = 2 l − 1,<br />

sequence {sn} is the same as the output sequence of the<br />

truncated multiplicative congruentialpseudor<strong>and</strong>omgenerator.<br />

To improvethe statistical propertiesof {pn}, successive pn are<br />

first written <strong>in</strong>to Table T with L cells, addressed from 0 to<br />

L − 1. Next, we read off K <strong>number</strong>s T1, T2, ..., TK from T<br />

per one iteration of equation (6), where it is assumed that<br />

L ≥ αK. The addresses of T1, T2, ..., TK depend on sn.<br />

Numbers T1, T2, ..., TK are treated as vectors encoded by l<br />

bits. The elements of K vectors are summed modulo 2 <strong>and</strong><br />

added modulo 2 to current <strong>number</strong> pn, denoted for clarity as<br />

T0, form<strong>in</strong>g a s<strong>in</strong>gle vector Un. Its elements can encode an<br />

<strong>in</strong>teger <strong>number</strong> from <strong>in</strong>terval (0, 2 l ) or a real <strong>number</strong> from<br />

unit <strong>in</strong>terval I = (0, 1). The pseudocode of an algorithm<br />

proposed for produc<strong>in</strong>g {Un} has the follow<strong>in</strong>g form:<br />

Algorithm 1 Algorithm CPRNG<br />

Initialization:<br />

Choose k, p0 ∈ (0, q0) <strong>and</strong> the size L of Table T;<br />

Write p0 <strong>in</strong>to the first cell of Table T, i.e. T [0] := p0;<br />

for n := � 1 to L − 1 do<br />

pn := λpn−1 mod q0, n = 1, 2, ...L − 1<br />

(7)<br />

T [n] := pn<br />

end for<br />

Computations:<br />

for n := 1 to N do<br />

⎧<br />

pn+L−1 := λpn+L−2 mod q0<br />

⎪⎨<br />

j := n mod L, L ≥ αK, α = 2<br />

⎪⎩<br />

k , 1 ≤ k ≤ l<br />

T [j] := pn+L−1<br />

s ′ n+L−1 := 1 + trunck(pn+L−1)<br />

Un := T [j] ⊕ T [ � j + s ′ �<br />

n+L−1 mod L]<br />

⊕ · · · ⊕ T [ � j + Ks ′ (8)<br />

�<br />

n+L−1 mod L]<br />

end for<br />

In (8) it is that s ′ n+L−1 = 1+sn+L−1. The comb<strong>in</strong>ed pseudor<strong>and</strong>om<br />

<strong>number</strong> generator CPRNG repeatedly uses the “bit<br />

stripp<strong>in</strong>g”,known from the shuffl<strong>in</strong>galgorithmsof Gebhardor<br />

Bays<strong>and</strong>Durham(seep.10<strong>in</strong>[2]).Numbers pn written<strong>in</strong>to T<br />

can be regarded as digits encod<strong>in</strong>g a certa<strong>in</strong> <strong>number</strong> p, written<br />

<strong>in</strong> the fixed-po<strong>in</strong>t <strong>number</strong> system with base q0. If {pn} is a<br />

r<strong>and</strong>om sequence, then all sequences composed of digits chosen<br />

from digits encod<strong>in</strong>g p are <strong>in</strong>dependent [2]. The addresses<br />

of <strong>number</strong>s T0, T1, .., TK differ by a constant value s ′ n+L−1 .<br />

Numbers s ′ n+L−1 are the elements of symbolicsequence {sn}<br />

produced by chaotic Sλ <strong>and</strong> realized <strong>in</strong> computer <strong>in</strong> the<br />

modulararithmetic – shifted by unity. The same algorithm can<br />

be used for other values q0 but symbols s ′ n+L−1 have to be<br />

computed from formula s ′ n+L−1 = 1 + trunck(pn+L−1/q0),<br />

i.e., they cannot be the most significant digits of pn+L−1<br />

<strong>in</strong>creased by 1. Chang<strong>in</strong>g the method of address<strong>in</strong>g Table T,<br />

we can obta<strong>in</strong> different comb<strong>in</strong>ed generators.<br />

The period mu ofsequence {Un} dependson theperiod mp<br />

of sequence {pn} <strong>and</strong> the size L of Table T. Table T is filled<br />

with L elements of sequence {pn} dur<strong>in</strong>g the Initialization.<br />

After n = LCM(mp, L) iterations of expression (8), where<br />

LCM(mp, L) is the least common multiple of <strong>number</strong>s mp<br />

<strong>and</strong> L, Table T is filled with the same <strong>number</strong>s as after the<br />

Initialization. For n > LCM(mp, L), we obta<strong>in</strong><br />

U n+LCM(mp,L) = Un. (9)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!