# Efficient Implementation of PRESENT and GIFT on Quantum Computers
## 4 Evaluation  
Proposed PRESENT and GIFT implementations are evaluated by using the quantum computer emulator IBM ProjectQ. IBM ProjectQ offers a variety of quantum computer compilers and can estimate quantum resources of quantum circuits. One of the quantum compilers, the resource counter, analyzes CNOT gates, Toffoli gates, \(X\) gates, and the qubits used in the quantum circuit and estimates the circuit depth. Proposed implementations focused on optimizing the number of quantum gates, circuit depth, and qubits. In Table 6, quantum resources to implement PRESENT and GIFT symmetric key cryptography as quantum gates are evaluated. In addition, the results of quantum implementation of other block ciphers, which have been studied recently, are shown. We compare proposed PRESNET and GIFT quantum circuit implementations with the SIMON, SPECK, and CHAM quantum circuit implementations. First, the optimal number of qubits was achieved, because qubits were only used to allocate plaintext and key. We generate a round key for each round, directly. By using this method, we use round key and update it as the next round key. Therefore, we allocate qubits for only the first key and recycle them to the end. In the implemented quantum circuit, no qubits were used until the completion of the final round. Since large-scale quantum computers have not yet been developed, optimizing the number of qubits required for quantum circuits should be considered. Second, in terms of quantum gates, PRESENT and GIFT belong to the low-cost group along with SIMON which is designed to be hardware friendly. When we implement quantum circuits, a relatively small number of quantum gates were used to perform the rounds. Particularly, we were able to save a lot of quantum gate cost by using the LIGHTER-R tool for PRESENT and hardware-friendly Sbox for the GIFT block cipher. The cost of quantum gates required for Sbox could be reduced, and as a result, overall quantum circuit optimization was achieved. Lastly, in terms of circuit depth, PRESENT and GIFT block ciphers are highly optimized compared to other block ciphers. The exact depth of SPECK and CHAM block ciphers has not been estimated, but it is higher than that of SIMON block cipher. In the case of AddRoundKey and Constant XOR of GIFT and PRESENT block ciphers, qubits do not interact with each other. Each can be performed with one parallel gate operation (depth of 1). The operation that takes up the most depth is Sbox, which is 9 for PRESENT Sbox and 10 for GIFT Sbox. The GIFT block cipher only performs Sbox for block \(B\) of each round, whereas the PRESENT block cipher uses Sbox for Keyschedule as well as block \(B\). In the PRESENT block cipher, Sbox operation of Keyschedule and Sbox operation of block \(B\) are independent each other. These operations are executed in parallel way. Therefore, the depth is the same as that when Sbox was executed once. With these features, GIFT and PRESENT block ciphers are highly optimized in terms of depth using a small depth in each round. Reducing the depth of the quantum circuit is important for optimization, because the overall execution time is shortened [17]. The reason that PRESENT-64/80 and PRESENT-64/128 block ciphers have the same depth is because the number of rounds is the same (31 rounds). According to [18], to attack block ciphers with [PERSON]'s search algorithm, known plain text and ciphertext pairs are required. In detail, \(r\) = (key length/block size) pairs are used. In [19], they estimated the quantum gates required to apply [PERSON]'s search algorithm in parallel to AES quantum circuit implementations. To apply the proposed PRESENT and GIFT quantum circuits to the [PERSON] search algorithm, (\(1+r\cdot q\)) qubits are used. \(q\) is qubits of Table 6.  
The PRESENT block cipher requires 4 instances since \(r\) = 2, therefore the number of gates is four times the Table 6 result. Since the \(r\) of GIFT-64/128 block cipher is 2, 4 instances are required, therefore the number of gates is four times the Table 6 result.