Abstract:
With the help of the space-efficient quantum Karatsuba algorithm for multiplication, the quantum implementation for the
8 \times 8 
S-box of AES-128 has been optimized. At the same time, the product of the number of qubits and the depth of T gates has been introduced to measure the tradeoff between time resource cost and space resource cost. It has been shown in the analysis of the implementation of the
8 \times 8 
S-box transformation that the circuit using the space-efficient quantum Karatsuba multiplication to find the multiplication inverse has better performance, and all of the number of Toffoli gates, the number of qubits, and the product of the number of qubits and the depth of T gates are all better. Furthermore, the method of windowed quantum lookups has been used in this paper to optimize the resource cost for implementing the multiplication inverse and the S-box. Based on them, the resource needed has been analyzed and verified in Qiskit.