1 Introduction
1.1 Background
1.2 Our contribution
1.3 Technical overview
2 Preliminaries
2.1 Elliptic curve discrete logarithm problem
2.2 Shor’s algorithm for binary ECDLP
2.3 Quantum computation in \({\mathbb {F}}_{2^n}\)
ADD
and \(\texttt {SQUARE}\) denote Banegas et al.’s algorithms [30] for addition and squaring, respectively, while \(\texttt {MODMULT}\) denote Kim et al.’s algorithm [35] for multiplication. Let f, g, and h be quantum states of elements in \({\mathbb {F}}_{2^n}\). Then, the algorithms are described as follows:ADD
, SQUARE
, and SQUARE
\(^{-1}\) are based on only CNOT gates. Specifically, the number of CNOT gates are n for ADD
, and at most \(n^2 - n\) for SQUARE
or SQUARE
\(^{-1}\). In contrast, \(\texttt {MODMULT}\) requires not only CNOT gates but also TOF gates. Throughout the paper, \(\texttt {ADD}\) and \(\texttt {MODMULT}\) may take only specific inputs. Let \(\varvec{0}\) denote a quantum state of a zero element in \({\mathbb {F}}_{2^n}\). Then, when we set \(g = \varvec{0}\) as the input of \(\texttt {ADD}\), given f and \(\texttt {ADD}(f, \varvec{0}) = (f, f)\) copy f to a new n-qubit register. Similarly, when we set \(h = \varvec{0}\) as the input of \(\texttt {MODMULT}\), given f, g and \(\texttt {MODMULT}(f, g, \varvec{0}) = (f, g, fg)\) writes fg in a new n-qubit register.3 FLT-based inversion
3.1 Classical FLT-based inversion
3.2 Putranto et al.’s quantum FLT-based inversion algorithm
SQUARE
which uses only CNOT gates. Here, we explain the main parts of Algorithm 1, i.e., the loop from line 1 to 5 and from line 6 to 9. ADD
to copy \(f_{2(i-1)} = \langle 2^{2^{i-1}}-1 \rangle \) in a new register \(f_{2(i-1) + 1}\). Then, we apply the \(\texttt {SQUARE}\) operation \(2^{i-1}\) times to \(f_{2(i-1) + 1} = \langle 2^{2^{i-1}}-1 \rangle \) and obtain \(\langle 2^{2^{i-1}}-1 \rangle ^{2^{2^{i-1}}}\) in the same register. Finally, we apply \(\texttt {MODMULT}\) to \(f_{2(i-1)} = \langle 2^{2^{i-1}}-1 \rangle \) and \(f_{2(i-1) + 1} = \langle 2^{2^{i-1}}-1 \rangle ^{2^{2^{i-1}}}\), and obtain \(\langle 2^{2^i}-1 \rangle \) in a new register \(f_{2(i-1) + 2}\). Therefore, we use the \(\texttt {MODMULT}\) operation \(k_1\) times and new \(2k_1\) registers, i.e., \(2k_1n\) qubits.3.3 Banegas et al.’s quantum FLT-based inversion algorithm
SQUARE
\(^{-1}\). On the other hand, due to the additional procedure, Algorithm 2 requires larger depth and more CNOT gates than Algorithm 1. We explain the loop from line 1 to line 8 in Algorithm 2 below. 4 Our method
4.1 Addition chain
-
for all \(s = 1, 2, \ldots , \ell \), there exist i and j which satisfy \(0 \le i,j < s\) and \(p_s = p_i + p_j\).
4.2 Basic algorithm
ADD
to copy \(\langle 2^{p_{a_u}}-1 \rangle \) in a new j-th register. Then, we apply the \(\texttt {SQUARE}\) operation \(2^{p_{a_u}}\) times to j-th register and obtain \(\langle 2^{2p_{a_u}} - 2^{p_{a_u}} \rangle \) in the same register. Finally, we apply \(\texttt {MODMULT}\) to \(\langle 2^{p_{a_u}}-1 \rangle \) in the i-th register and \(\langle 2^{2p_{a_u}} - 2^{p_{a_u}} \rangle \) in the j-th register, and obtain \(\langle 2^{2^{2p_{a_u}}}-1 \rangle \) in a new k-th register. Due to \(u \in D\), it holds that \(p_u = p_{a_{u}}+p_{a_{u}} = 2p_{a_{u}}\), i.e., \(\langle 2^{2^{2p_{a_u}}}-1 \rangle = \langle 2^{p_u} - 1 \rangle \). Here, we use the \(\texttt {MODMULT}\) operation once and new two registers (j-th and k-th register), i.e., 2n qubits.4.3 Extended algorithm
ADD
to clear garbages. The sequence \(\{c\ell _t\}_{s=0}^{t}\) describe the number of times to applying SQUARE
or SQUARE
\(^{-1}\) for clearing garbages. More precisely, we apply SQUARE
\(c\ell _t\) times if \(c\ell _t > 0\) and SQUARE
\(^{-1}\) \(-c\ell _t\) times if \(c\ell _t < 0\). We set \(c\ell _0 = 0\) and \(\overline{x} {:=}x\mod (d-L)\). Garbages are stored in \(h_0,\ldots ,h_{d-L-1}\) in turn and clearing is performed by initializing them to 0 from \(h_0\) to \(h_{d-L-1}\) in this order. We describe the algorithm for clearing garbages in Algorithm 5. We note that the case of \(L=0\) is different from basic algorithm since clearing to store \(\langle 2^{n-1}-1 \rangle \) is still performed. When \(L = d-1\), we only prepare a polynomial \(h_0\) for garbages; however, initializing is performed whenever we compute \(\langle 2^{p_s}-1 \rangle \), where \(s \in D\). In general, each time L increases by 1, we apply an additional clearing that implicates the trade-off between the number of qubits and the number of CNOT gates, and the depth.5 Comparison
5.1 Our choice of addition chains
n | 163 | 233 | 283 | 571 |
---|---|---|---|---|
d | 7 | 7 | 8 | 9 |
m | 2 | 3 | 3 | 4 |
\(\ell \) | 9 | 10 | 11 | 13 |
n | 163 | 233 | 283 | 571 |
---|---|---|---|---|
d | 5 | 4 | 3 | 4 |
m | 4 | 6 | 8 | 8 |
\(\ell \) | 9 | 10 | 11 | 12 |
5.2 Comparison in a quantum inversion computation
-
basic algorithm: our proposed Algorithm 3
-
extended algorithm: our proposed Algorithm 4 for \(L=d-1\)
-
PWLK22-FLT: Putranto et al.’s FLT-based algorithm
-
BBHL21-FLT: Banegas et al.’s FLT-based algorithm
-
BBHL21-GCD: Banegas et al.’s GCD-based algorithm
ADD
is 1. We calculate the number of CNOT gates and the upper bound of the depth of SQUARE
by using LUP decomposition which Banegas et al.’s [30] used. The number of TOF gates and CNOT gates and the upper bound of the depth of MODMULT
are given by Hoof [34]. We also calculate the depth considering parallel computation by ourselves, although we do not describe it in detail. However, since paralleling is not complete, the depth is upper bound in each case.n | Sequences | ||
---|---|---|---|
163 | \(p_s\) | : | 1, 2, 4, 8, 16, 32, 33, 65, 97, 162 |
\(a_s\) | : | 0, 1, 2, 3, 4, 5, 5, 7, 8 | |
\(b_s\) | : | 0, 1, 2, 3, 4, 0, 6, 5, 7 | |
\(Q_s\) | : | 1, 2, 4, 8, 16, 1, 32, 32, 65 | |
233 | \(p_s\) | : | 1, 2, 4, 8, 16, 24, 40, 56, 96, 136, 232 |
\(a_s\) | : | 0, 1, 2, 3, 4, 4, 4, 7, 8, 8 | |
\(b_s\) | : | 0, 1, 2, 3, 3, 5, 6, 6, 6, 9 | |
\(Q_s\) | : | 1, 2, 4, 8, 8, 16, 16, 40, 40, 96 | |
283 | \(p_s\) | : | 1, 2, 4, 6, 12, 18, 30, 48, 78, 126, 204, 282 |
\(a_s\) | : | 0, 1, 2, 3, 4, 4, 6, 6, 8, 8, 8 | |
\(b_s\) | : | 0, 1, 1, 3, 3, 5, 5, 7, 7, 9, 10 | |
\(Q_s\) | : | 1, 2, 2, 6, 6, 12, 18, 30, 48, 78, 78 | |
571 | \(p_s\) | : | 1, 2, 4, 8, 16, 18, 34, 50, 84, 134, 218, 352, 570 |
\(a_s\) | : | 0, 1, 2, 3, 4, 4, 4, 7, 7, 9, 9, 11 | |
\(b_s\) | : | 0, 1, 2, 3, 1, 5, 6, 6, 8, 8, 10, 10 | |
\(Q_s\) | : | 1, 2, 4, 8, 2, 16, 16, 34, 50, 84, 134, 218 |
n | Basic algorithm | Extended algorithm | ||||||
---|---|---|---|---|---|---|---|---|
TOF | Qubits | CNOT | Depth | TOF | Qubits | CNOT | Depth | |
163 | 18, 848 | 2771 | 1, 557, 528 | 300, 920 | 18, 848 | 1956 | 1, 579, 944 | 310, 830 |
233 | 30, 261 | 3961 | 3, 345, 540 | 434, 995 | 30, 261 | 3029 | 3353, 750 | 437, 747 |
283 | 41, 032 | 4811 | 5, 489, 296 | 837, 096 | 41, 032 | 3962 | 5, 502, 090 | 840, 612 |
571 | 95, 325 | 10, 849 | 23, 458, 648 | 3, 433, 263 | 95, 325 | 8565 | 23, 514, 068 | 3, 456, 469 |
n | PWLK22-FLT | BBHL21-FLT | ||||||
---|---|---|---|---|---|---|---|---|
TOF | Qubits | CNOT | Depth | TOF | Qubits | CNOT | Depth | |
163 | 18, 848 | 3097 | 1, 558, 180 | 300, 924 | 18, 848 | 1956 | 1, 601, 716 | 342, 516 |
233 | 30, 261 | 4660 | 3, 346, 938 | 435, 001 | 30, 261 | 3029 | 3, 374, 430 | 459, 709 |
283 | 41, 032 | 6226 | 5, 492, 126 | 837, 106 | 41, 032 | 3962 | 5, 644, 678 | 985, 710 |
571 | 102, 951 | 14, 275 | 25, 189, 566 | 3, 556, 815 | 102, 951 | 9136 | 26, 043, 772 | 4, 401, 901 |
n | BBHL21-GCD | |||||||
---|---|---|---|---|---|---|---|---|
TOF | Qubits | CNOT | Depth | |||||
163 | 438, 766 | 1156 | 414, 586 | 510, 628 | ||||
233 | 823, 095 | 1646 | 834, 256 | 992, 766 | ||||
283 | 1, 194, 498 | 1997 | 1, 222, 600 | 1, 449, 098 | ||||
571 | 4, 434, 315 | 4014 | 4, 857, 244 | 5, 602, 181 |
5.3 Quantum resources trade-off in extended algorithm
5.4 Comparison in Shor’s algorithm
\(n=163\) | Qubits | CNOT | Depth | |
---|---|---|---|---|
Basic | 2771 | 1, 557, 528 | 300, 920 | |
L | 0 | 2608 | 1, 558, 514 | 300, 920 |
1 | 2445 | 1, 560, 486 | 301, 584 | |
2 | 2282 | 1, 563, 452 | 302, 906 | |
3 | 2119 | 1, 569, 058 | 305, 548 | |
4 | 1956 | 1, 579, 944 | 310, 830 |
\(n=233\) | Qubits | CNOT | Depth | |
---|---|---|---|---|
Basic | 3961 | 3, 345, 540 | 434, 995 | |
L | 0 | 3728 | 3, 346, 398 | 434, 995 |
1 | 3495 | 3, 348, 114 | 435, 391 | |
2 | 3262 | 3, 350, 148 | 436, 177 | |
3 | 3029 | 3, 353, 750 | 437, 747 |
\(n=283\) | Qubits | CNOT | Depth | |
---|---|---|---|---|
Basic | 4811 | 5, 489, 296 | 837, 096 | |
L | 0 | 4528 | 5, 491, 032 | 837, 096 |
1 | 4245 | 5, 494, 504 | 838, 270 | |
2 | 3962 | 5, 502, 090 | 840, 612 |
\(n=571\) | Qubits | CNOT | depth | |
---|---|---|---|---|
Basic | 10, 849 | 23, 458, 648 | 3, 433, 263 | |
L | 0 | 10, 278 | 23, 463, 104 | 3, 433, 263 |
1 | 9707 | 23, 472, 016 | 3, 436, 581 | |
2 | 9136 | 23, 486, 414 | 3, 443, 211 | |
3 | 8565 | 23, 514, 068 | 3, 456, 469 |
n | Basic algorithm | |||
---|---|---|---|---|
TOF | Qubits | CNOT | Depth | |
163 | 13, 175, 432 | 2772 | 1, 072, 118, 184 | 204, 448, 960 |
233 | 30, 000, 204 | 3962 | 3, 276, 928, 512 | 423, 198, 828 |
283 | 49, 121, 208 | 4812 | 6, 491, 648, 712 | 977, 034, 976 |
571 | 228, 787, 416 | 10, 850 | 55, 651, 292, 840 | 8, 000, 884, 320 |
n | Extended algorithm | |||
---|---|---|---|---|
TOF | Qubits | CNOT | Depth | |
163 | 13, 175, 432 | 1957 | 1, 086, 823, 080 | 210, 949, 920 |
233 | 30, 000, 204 | 3030 | 3, 284, 613, 072 | 425, 774, 700 |
283 | 49, 121, 208 | 3963 | 6, 506, 182, 696 | 981, 029, 152 |
571 | 228, 787, 416 | 8566 | 55, 778, 093, 800 | 8, 053, 979, 648 |
n | PWLK22-FLT | |||
---|---|---|---|---|
TOF | Qubits | CNOT | Depth | |
163 | 13, 175, 432 | 3098 | 1, 072, 545, 896 | 204, 451, 584 |
233 | 30, 000, 204 | 4661 | 3, 278, 237, 040 | 423, 204, 444 |
283 | 49, 121, 208 | 6227 | 6, 494, 863, 592 | 977, 046, 336 |
571 | 246, 235, 704 | 14, 276 | 59, 611, 633, 224 | 8, 283, 571, 296 |
n | BBHL21-FLT | |||
---|---|---|---|---|
TOF | Qubits | CNOT | Depth | |
163 | 13, 175, 432 | 1957 | 1, 101, 105, 512 | 231, 735, 936 |
233 | 30, 000, 204 | 3030 | 3, 303, 969, 552 | 446, 331, 132 |
283 | 49, 121, 208 | 3963 | 6, 668, 162, 664 | 1, 145, 860, 480 |
571 | 246, 235, 704 | 9137 | 61, 566, 056, 552 | 10, 217, 128, 064 |
n | BBHL21-GCD | |||
---|---|---|---|---|
TOF | Qubits | CNOT | Depth | |
163 | 288, 641, 640 | 1157 | 322, 348, 232 | 342, 017, 408 |
233 | 772, 092, 828 | 1647 | 926, 366, 688 | 945, 272, 484 |
283 | 1, 359, 458, 584 | 1998 | 1, 644, 682, 056 | 1, 672, 269, 248 |
571 | 10, 156, 396, 536 | 4015 | 13, 091, 280, 488 | 12, 963, 368, 704 |
6 Windowing
6.1 Quantum read-only memory
6.2 Point addition using windowing
n | Basic algorithm | Extended algorithm | ||||
---|---|---|---|---|---|---|
w | TOF | w | TOF | |||
163 | 9 | 1, 781, 025 | 9 | 1, 781, 025 | ||
233 | 9 | 3, 679, 975 | 9 | 3, 679, 975 | ||
283 | 10 | 5, 765, 145 | 10 | 5, 765, 145 | ||
571 | 11 | 23, 390, 601 | 11 | 23, 390, 601 |
n | PWLK22-FLT | BBHL21-FLT | BBHL21-GCD | |||
---|---|---|---|---|---|---|
w | TOF | w | TOF | w | TOF | |
163 | 9 | 1, 781, 025 | 9 | 1, 781, 025 | 13 | 26, 303, 013 |
233 | 9 | 3, 679, 975 | 9 | 3, 679, 975 | 14 | 64, 402, 483 |
283 | 10 | 5, 765, 145 | 10 | 5, 765, 145 | 15 | 108, 252, 597 |
571 | 11 | 24, 976, 809 | 11 | 24, 976, 809 | 16 | 704, 590, 641 |
LOOKUP
to access the above QROM is explained by Banegas et al. [30]. We can decrease the times of point addition from \(2(n+1)\) to \(2\lceil \frac{n+1}{w} \rceil +1\)2, therefore the number of TOF gates decreases with increasing w. However, the number of TOF gates to construct a QROM is \(2(2^w-1)\).