Keywords

1 Introduction

The cellular automata (CAs) that generate large cycles are highly useful in computational processes like pseudo random number generator (PRPG) [5, 7], cryptosystem [3, 6] etc. Prior works have considered the use of linear maximal length cellular automata [1, 2] for such applications, where the cycle length is as large as \(2^n -1\) for an n-cell binary cellular automaton (CA). Linear maximal length CAs, however, suffer from some drawbacks. Firstly, the availability of n-degree primitive polynomial is limited. Besides, linear maximal length sequences are not secure. So, there is a necessity of a construction that can provide both non-linearity and maximal length sequence for optimized crypto-system (see [3, 6] for details).

There have been some researches to introduce non-linearity in maximal length CAs [3, 6]. The technique referred in [3] manipulates the number of clock cycles, based on inputs, in a maximum length additive CA. This method becomes unsynchronized for different inputs. An efficient technique [6] is devised for generating non-linear maximal length CA from linear maximal length CA by injecting non-linearity in different cell positions. The effect of the non-linearity can be propagated among multiple cells by shifting the non-linear function. However, it incurs increasing neighborhood dependency. For optimal design, the construction of non-linear maximal length CA limits upto 5 neighborhood. This motivates us to figure out if there exists a non-linear maximal length CA without exceeding the neighborhood dependency. In this paper we answer this question in an affirmative way.

2 Basics

2.1 Definitions

A 1-d finite CA of size n consists of an array of n cells. Each cell can be in either of two states, 0 or 1 as we use binary CA. Let \(x_i\) denote the state of cell i. Then, a configuration of the CA is \(x=(x_0x_1\cdots x_{n-1})\) where \(x_i \in \{0,1\}\). In this work, we consider null boundary CA, which means \(x_{-1} = x_{n} = 0\). Cell i of the CA changes its state at every time step following a next state function \({f_i}:\{0,1\}^3 \mapsto \{0, 1\}\), which is defined over the present states of cell i and its left and right neighbors. Let us denote \(\mathcal {C}\) as the set of all possible configurations of the CA. The CA thus can be interpreted as a function \(F:\mathcal {C}\rightarrow \mathcal {C}\), which satisfies the following conditions: \(y=F(x)\), \(x,y\in \mathcal {C}\), where \(y=(y_i)_{0\le i\le {n-1}}\) and \(y_i={f_i}(x_{i-1},x_i,x_{i+1})\).

There can be eight possible combinations depending on the present states of a cell and its two neighbours. The next state for the cell for each of these combinations depends on the next state function. Thus there can be \(2^8\) distinct next state functions, and each next state function can be associated to a value between 0 and 255, which we call rule. The rule corresponding to a particular next state function is obtained as the decimal equivalent of next state generated for the eight combinations of the present states \(x_{i-1}\), \(x_i\) and \(x_{i+1}\) (as shown in Table 1). For a particular rule \({\mathcal R}\), let \({\mathcal R[x_{i-1}x_{i}x_{i+1}]}\) denote the next state of cell i for the present states combination \(x_{i-1}x_{i}x_{i+1}\) of cell i and its neighbours. For example, 30[011] = 1. Thus a CA can alternatively be interpreted as a rule vector \({\mathcal {R}} = ({\mathcal R_0}, {\mathcal R_1}, \cdots , {\mathcal R_i}, \cdots , {\mathcal R_{n-1}})\), where each \({\mathcal R_i}\) is the rule to which \(f_i\) is associated. The uniform CA is a special case where \({\mathcal R_0}= {\mathcal R_1}= \cdots ={\mathcal R_i}= \cdots ={\mathcal R_{n-1}}\). If an \({\mathcal R_i}\) of an n-cell CA is said to be linear if its corresponding \(f_i\) follows XOR logic.

Definition 1

If all the rules of a rule vector \({\mathcal R}\) are linear/additive, then the CA is linear/additive.

Here, we consider only seven rules as linear – 60, 90, 102, 150, 170, 204 and 240. Another seven rules (15, 51, 85, 105, 153, 165 and 195) are complemented additive rules.

Definition 2

If any \({\mathcal R_i}\) of \({\mathcal R}\) is not linear/ additive, then CA is non-linear.

Table 1. Rules 90, 150, 54 and 30

Definition 3

A configuration \(x\in \mathcal {C}\) is said to be cyclic if \(x=F^t(x)\) for some finite \(t\in \mathbb {N}\).

Definition 4

A CA is reversible if all the configurations are cyclic.

2.2 Synthesis of Reversible CAs

Synthesis of a reversible CA given in [4]. Here we briefly present the methodologies for sake of completeness.

Only 62 out of the 256 possible rules are used to form non-uniform reversible CAs. These rules can be classified into different classes as shown in Tables 2, 3 and 4. We now state how a reversible CA can be generated from these tables. The rule at the cell zero i.e., \({\mathcal R_0}\) is selected out of the rules given in first column of Table 2. Note that the first and last rules of a null boundary CA are to be chosen differently (see [4] for details). However, the selected rule at the cell zero defines the class (second column of Table 2) from which \({\mathcal R_1}\) has to be selected. For every i between 1 and \(n-2\), the first column of Table 4 shows the probable classes of rule \({\mathcal R_i}\); the second column shows the possible rules for rule \({\mathcal R_i}\) from each class, while corresponding to a particular rule \({\mathcal R_i}\), the third column defines the class from which \({\mathcal R_{i+1}}\) has to be selected. Finally, depending on the class of the rule at the last cell, the rule \({\mathcal R_{n-1}}\) is selected from Table 3.

Example 1

Let us consider a 4-cell CA (10, 150, 90, 20) which is reversible. It is obtained as follows: here, \({\mathcal R_0}\) is 10. The class of \({\mathcal R_1}\) is II (see Table 2). Thus the rule at cell 1 must be selected from the row corresponding to class II of Table 4. In particular, let \({\mathcal R_1}\) is selected to be 150. \({\mathcal R_2}\) should be selected from class I, as the class for selecting the next rule corresponding to rule 150 is class I (see last column of Table 4). Let \({\mathcal R_2}\) is selected as 90. Applying the same methodology, the class of rule \({\mathcal R_3}\) comes out to be class II. From Table 3, the rule \({\mathcal R_3}\) is selected from the row corresponding to class II, in particular \({\mathcal R_3}\) is selected to be 20.

Definition 5

An n-cell CA is maximal length if, for a configuration \(x\in \mathcal {C}\), \(x=F^{2^n-1}(x)\), but \(x\ne F^t(x)\) where \(1\le t < 2^n-1\).

The CA (10, 150, 90, 20) is equivalent to the CA (90, 150, 90, 150) when the boundary condition is null. That is, this CA is linear. Further, it is a maximal length CA (see Fig. 1).

Fig. 1.
figure 1

Configuration transition diagram of the CA (10, 150, 90, 20)

Table 2. First rule table
Table 3. Last rule table
Table 4. Class relationship of \(R_i\) and \(R_{i+1}\)

3 Cellular Automata with Large Cycles

Maximal length CAs are having the largest possible cycle length for given CA size n. In this section we develop a process to design CAs which are expected to have large cycles. If non-linear maximal length CAs really exist, we can get such CAs by repeatedly applying this process.

We first intuitively present the idea behind our approach. Clearly, a cell i changes its state in next time step depending on the present states of itself and its neighbours. If the cells of a CA does not depend on their neighbors, the CA cannot produce large cycles. For example, in the extreme case, if \(f_i(x_{i-1}, x_i, x_{i+1}) = x_i\) for all i, then every cycle is of length one. Similarly, if \(f_i(x_{i-1}, x_i, x_{i+1}) = 1- x_i\) for all i, every cycle is of length two. Thus lower the dependency of the next state function on the present state of the neighbours of a cell, smaller will be the length of the cycles generated by the corresponding CA. Conversely, if the next state of a cell is more influenced by the state of its neighbours, greater is the chance of obtaining a large length cycle.

Let \((x_0x_1\cdots x_i\cdots x_{n-1})\) denote a configuration of the CA. Suppose \({f_{i}} (x_{i-1}, x_{i}, x_{i+1})={f_{i}}(x_{i-1},x_{i},{1- x_{i+1}})\), for all values of \(x_i\) and \(x_{i-1}\). This implies that the next state of cell i is not influenced by the present state of cell \(i+1\); we say that cell i is independent of its right neighbor. In an analogous manner, if \({f_{i}}(x_{i-1},x_{i},x_{i+1})= {f_{i}}(1- x_{i-1},x_{i},{x_{i+1}})\) for all values of \(x_i\) and \(x_{i+1}\), cell i is independent of its left neighbor.

We can define the degree of dependence on the neighbor of a cell as follows. Let \({\alpha _{rd}}{\left( {{x_{i-1} = \mathtt{x}}, {x_i = \mathtt{y}}}\right) }\) denote the dependence of cell i on its right neighbor when the present states of \(x_{i-1}\) and \(x_i\) are respectively \(\mathtt{x}\) and \(\mathtt{y}\). Note that each of \(\mathtt{x}\) and \(\mathtt{y}\) can be either 0 or 1.

$$ {\alpha _{rd}}{\left( {{x_{i-1} = \mathtt{x}}, {x_i = \mathtt{y}}}\right) }= {\left\{ \begin{array}{ll} 1&{} \text {if } {f_i(\mathtt{x}, \mathtt{y} , x_{i+1})}\ne {f_i(\mathtt{x}, \mathtt{y} , 1 - x_{i+1})}\\ 0 &{} \text {otherwise} \end{array}\right. } $$

The degree of dependence of cell i on its right neighbor is the ratio of the number of combinations of values of \(x_i\) and \(x_{i-1}\) for which the next state function on \(x_i\) depends on \(x_{i-1}\). This is called the degree of right dependence for rule \(\mathcal {R}_i\) and denoted by \(\mathtt{P_r} ({\mathcal {R}_i})\). Clearly, \(\mathtt{P_r}({\mathcal {R}_i})\) can take values 0, 0.5 or 1. Formally,

$$ \mathtt{P_r}(\mathcal {R}_i) =\frac{\sum _{\mathtt{x} \in \{0,1\}} \sum _{\mathtt{y} \in \{0,1\}}{\alpha _{rd}}{\left( {{x_{i-1} = \mathtt{x}}, {x_i = \mathtt{y}}}\right) }}{4} $$

Similarly, let \({\alpha _{ld}}{\left( {{x_{i} = \mathtt{x}}, {x_{i+1} = \mathtt{y}}}\right) }\) denote the dependence of cell i on its left neighbor when the present states of \(x_{i}\) and \(x_{i+1}\) are respectively \(\mathtt{x}\) and \(\mathtt{y}\).

$$ {\alpha _{ld}}{\left( {{x_{i} = \mathtt{x}}, {x_{i+1} = \mathtt{y}}}\right) }= {\left\{ \begin{array}{ll} 1&{} \text {if } {f_i({x_{i-1}}, \mathtt{x} , \mathtt{y})}\ne {f_i(1-{x_{i-1}}, \mathtt{x} , \mathtt{y})}\\ 0 &{} \text {otherwise} \end{array}\right. } $$

In an analogous way, we define the parameter \(\mathtt{P_l}\) which determines how much a cell i depends on its left neighbor. It is the ratio of the number of combinations of values of \(x_i\) and \(x_{i+1}\) for which the next state function on \(x_i\) depends on \(x_{i+1}\). This is called the degree of left dependence for rule \(\mathcal {R}_i\), and denoted by \(\mathtt{P_l}(\mathcal {R}_i)\).

$$ \mathtt{P_l}(\mathcal {R}_i) =\frac{\sum _{\mathtt{x} \in \{0,1\}} \sum _{\mathtt{y} \in \{0,1\}}{\alpha _{ld}}{\left( {{x_{i} = \mathtt{x}}, {x_{i+1} = \mathtt{y}}}\right) }}{4} $$

Example 2

Let us consider rule 54. We observe that for the next state function corresponding to this rule, \({\alpha _{rd}}{\left( {{x_{i-1} = \mathtt{0}}, {x_i = \mathtt{0}}}\right) }= 1, {\alpha _{rd}}{\left( {{x_{i-1} = \mathtt{0}}, {x_i = \mathtt{1}}}\right) }= 1\), while \({\alpha _{rd}}{\left( {{x_{i-1} = \mathtt{1}}, {x_i = \mathtt{0}}}\right) }= 0, {\alpha _{rd}}{\left( {{x_{i-1} = \mathtt{1}}, {x_i = \mathtt{1}}}\right) }= 0\). Therefore, \(\mathtt{P_r(54)}\) is 0.5. On the other hand, \({\alpha _{ld}}{\left( {{x_{i} = \mathtt{0}}, {x_{i+1} = \mathtt{0}}}\right) } = 1, {\alpha _{ld}}{\left( {{x_{i} = \mathtt{1}}, {x_{i+1} = \mathtt{0}}}\right) } = 1\), while \({\alpha _{ld}}{\left( {{x_{i} = \mathtt{1}}, {x_{i+1} = \mathtt{1}}}\right) } = 0, {\alpha _{ld}}{\left( {{x_{i} = \mathtt{1}}, {x_{i+1} = \mathtt{0}}}\right) } = 0\). Therefore, \(\mathtt{P_l}(54)\) is 0.5. Similarly, for rules 90 and 60, \(\mathtt{P_r}(90) = 1\) and \(\mathtt{P_r}(60) = 0\). For rules 150 and 170, we get \(\mathtt{P_l}(150) = 1\) and \(\mathtt{P_l}(170) = 0\).

The rules of reversible CAs can be classified into three categories depending on \(\mathtt{P_r}\) and \(\mathtt{P_l}\) parameter. The three categories are named as completely right dependent, partially right dependent and right independent, and they correspond respectively to right dependence degree values of 0, 0.5 and 1. In null boundary condition, all possible inputs to first and last rules are not valid. So, we need to classify first and last rules separately using the same process stated above.

In order to have a CA generates a cycle of \({2^n}-1\) length, it is desirable to have the rules of the CA dependent on both the left and the right neighbours. The degree of dependence of a rule \(\mathcal {R}_i\) on both of its neighbours can be determined by the product of \(\mathtt{P_r}(\mathcal {R}_i)\) and \(\mathtt{P_l}(\mathcal {R}_i)\), and we denote this by \(\mathtt{P}(\mathcal {R}_i)\).

$$\begin{aligned} \mathtt{P}(\mathcal {R}_i) = \mathtt{P_r}(\mathcal {R}_i) * \mathtt{P_l}(\mathcal {R}_i). \end{aligned}$$

Clearly, \(\mathtt{P}(\mathcal {R}_i)\) can take values 0, 0.25, 0.5 or 1. We can thus classify the rules here into four categories based on the \(\mathtt{P}\) parameter. As shown in Table 5, any rule can correspond to either of the four categories completely dependent, partially dependent, weakly dependent and independent depending on the \(\mathtt{P}\) values of 1, 0.5, 0.25 and 0 respectively. However, to obtain a large cycle, we generate the corresponding CA by selecting rules from Table 5 as follows.

The first and the last rules of every CA are selected uniformly at random from the class of completely dependent. For the remaining, we pick \(n-2\) rules randomly following Gaussian distribution in such a way that the maximum rules are selected from the category of completely dependent, some selected from the category of partially dependent, and a very few from the category of weakly dependent. Since most of the rules, selected in this manner, have high degree of dependence on both of their neighbours, it is highly likely that the corresponding CA will have a large cycle.

Table 5. Four categories of reversible CA rules on the parameter \(\mathtt{P}\)

4 Experimental Results

Using the above mentioned approach, we generate a number of CAs of different sizes. We observe that the cycles of the synthesized CAs are large, and most of the time, the largest cycle of such CAs are close to \(2^n-1\). Table 6 shows a sample result of our experiment. Bold faced rows are the non-linear maximal length CAs. This result proves that there exist non-linear maximal length CAs.

Table 6. Cycles are close to \(2^k - 1\) for k-cell CA (Here \(k = 10\))

Let us now understand the percentage frequency distribution of different categories of rules which can generate non-linear maximal length by using the above process. For CA size 10, we generate 100 non-linear maximal length CAs and using these data, we observe that 83% of the rules belong to completely dependent category, 13.8% belong to the partially dependent class, while 3.02% belong to the weakly dependent class.

To understand the efficacy of the above mentioned approach, we conduct experiments. We generate random non-linear maximal length reversible CAs of size n extensively. Obviously, each CA follows a distribution for the rules being selected from the different categories based on \(\mathtt{P}\) which mentioned already. By maintaining this distribution, we get CAs of length \(2^n -1\) of a fixed CA size n. We perform experiment for different values of n ranges from 4 to 20. Here, by experiments, we observe that there exists a non-linear maximal length CA for any n. In Table 7, we shows the CAs which contributes maximal length CA for sizes 4 to 20.

From the experimental results, however, we observe that sixteen rules from category weakly dependent have not participated in the maximal length CA generation. These rules are 92, 172, 197, 202, 108, 156, 198, 201, 77, 142, 212, 232, 78, 141, 216, 228.

Table 7. n-cell non-linear maximal length CAs