## 3 Fusion Precomputed AES Encryption Algorithm
### Precomputation-Based S-Box Construction  
The AES Substitution Box is an important component of the AES encryption algorithm for replacing bytes in the input data. The S-box is a fixed two-dimensional array of \(16\times 16\) bytes, where each element is an 8-bit byte. In AES, S-boxes are used to replace each byte in a block of input data (e.g., a byte), thereby increasing the complexity and security of the encryption. In this, S-boxes are used for encryption and inverse S-boxes are used for decryption. A customized S-box is used in this paper to further improve the security and construction speed of the S-box in the following steps:  
Step 1: First, define a finite domain \(GF(2^{8})\), also known as the byte domain, which refers to bytes with values from 0x00 to 0 xFF, and then generate the exponent \(EXP\) and the logarithm \(LOG\). The exponent table stores the results of exponential operations on all elements of the finite field \(GF(2^{8})\) and the log table stores the logarithmic values of these results. It is used to compute its inverse in \(GF(2^{8})\). That is, according to the exponential and logarithmic tables, for each byte \(b\) (from 0x01 to 0 xFF) of the finite field \(GF(2^{8})\), find another byte \(a\) such that \(a\times b=1\). Step 2: A multiplication operation function \(mul(a,b)\) is defined that uses pre-generated exponential and logarithmic tables. Specifically, suppose we want to compute the multiplication result of two elements \(a\) and \(b\). First, look up the exponent values corresponding to the elements \(a\) and \(b\) in the exponent \(EXP\), denoted \(a_{\text{exp}}\) and \(b_{\text{exp}}\), respectively. Then, add these two exponent values and take the modulus to get the exponent value of the multiplication result \(c_{\text{exp}}\):  
\[c_{\text{exp}}=(a_{\text{exp}}+b_{\text{exp}})\text{mod}255 \tag{7}\]  
Finally, the result of the multiplication operation is obtained by looking up the byte value \(c_{\text{log}}\) in the logarithmic \(LOG\), which corresponds to the index value \(c_{\text{exp}}\). For example, let us calculate the multiplication result of element 0x03 and element 0x05. First, we look up the exponent values of element 0x03 and element 0x05 in the exponent table, which are two and four, respectively, and then we add these two exponent values to get the exponent value of the multiplication result \(c_{\text{exp}}=2+4=6\). Finally, we look up the byte value corresponding to the exponent value six in the logarithm table. According to the logarithmic table, the corresponding byte value is eight, and the result of the multiplication operation can be obtained. Step 3: To perform an affine transformation, for the input byte values, first treat the bytes as vectors on \(GF(2^{8})\) and apply a fixed matrix transformation, then change the byte  
Figure 3: Common computation processes and precomputation processes. values by adding the bytes in the matrix to a fixed byte matrix to generate each element in the S-box. Step 4: To perform differential diffusion, apply the differential diffusion algorithm on each byte value after affine transformation. In this paper, we used a custom \(5\times 5\) filter with the highest weight on the center pixel and lower weights on the surrounding pixels. This can highlight the differences between different byte values, thus increasing the randomness of the S-box and its resistance to differential attacks. Box 1 is the S box that generates the pseudo-code:  
**Box 1. ** S box generates the pseudo-code. 1. Define the multiplication function mul(a, b):  
If a = 0 or b = 0, return 0. Otherwise, return EXP[(LOG[a] + LOG[b]) % 255]. 2. Initialize the exponential table EXP and logarithmic table LOG:  
EXP[0] = 1. For i from 1 to 254:  
EXP[i] = EXP[i - 1] << 1. If EXP[i] >= 256, apply the modulus polynomial: EXP[i] = 0x11B. For i from 0 to 254:  
LOG[EXP[i]] = i.  
EXP[255] = EXP[0]. 3. Define the affine transformation function affineTransform(x):  
Generate a random multiplication factor rand_mult. Generate a random addition factor rand_add.