Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

Quantum cryptography is the study of the security of information processing in a quantum world. While quantum key distribution [4] is today the most widely successful quantum cryptographic technology [7, 12], quantum information effectively re-defines many cryptographic paradigms [6]. Among these is the need for new definitions and protocols for cryptographic tasks that operate on quantum data, such as quantum secret sharing [9] and quantum multi-party computation [3]. Another fundamental task is quantum message authentication.

Quantum message authentication schemes, introduced in [2], are families of keyed encoding and decoding maps which allow for the detection of tampering on encoded quantum data. These codes were originally given in a very efficient form, based on purity testing [2], and were shown to also satisfy a composable security notion [14].

Further quantum message authentication schemes have been proposed, including the signed polynomial code[1, 3], the trap code [5] and the Clifford code [1, 11]. These schemes have a nice algebraic form, which makes them particularly easy to study. Perhaps the main reason for interest in these schemes is that they have a sufficient amount of “structure” to enable evaluation of quantum gates over the encoded data (this technique is called quantum computing on authenticated data (QCAD)). This has lead to protocols for multi-party quantum computation [3], quantum one-time programs [5] and the verification of quantum computations [1].

The security of quantum message authentication schemes is typically defined in terms of the existence of a simulator that, given access only to the ideal functionality for quantum message authentication (which is a virtual device that either transmits the quantum data directly and outputs “accept”, or replaces it with a dummy state and outputs “reject”), is able to emulate the behaviour of the adversary so that the real-world protocol (involving the adversary) is statistically indistinguishable from the ideal-world protocol (involving the simulator). This type of definition fits in the quantum Universal Composability (UC)[8, 16] framework, as long as we add a further condition: if the adversary runs in polynomial time, so must the simulator (an efficient simulation). Until now, direct efficient simulations were known only for the purity-testing based codes [2].

In this work, we show a new family of efficient simulators for quantum message authentication schemes. The main idea is that the simulator replaces the entire codeword by half-EPR pairs (keeping the remaining half to itself), and runs the adversary on these entangled states (as well as the reference system for the original input). After the attack is applied, the simulator performs Bell basis measurements in order to verify the integrity of the EPR pairs. So long as enough EPR pairs are found to be intact, the simulator makes the ideal functionality “accept”; otherwise, it makes it “reject”. It is well-known that this Bell basis measurement will detect any non-identity Pauli attack—given the structure of the codes that we analyze, we show that this is sufficient.

We apply this type of simulator to the Clifford and trap quantum message authentication codes. We note that the Clifford code was previously proven secure according to an algebraic definition, without an efficient simulation [1, 11], and that the trap scheme was proven secure according to a simulator for a more elaborate ideal functionality for quantum one-time programs [5]. We thus establish for the first time efficient simulators for these codes (note, however, that we make extensive use of the algebraic tools developed in these prior works, and that we achieve the same security bounds). We also note that the idea of using EPR-pair testing as a proof technique for quantum message authentication has appeared in [2], where a more elaborate type of testing (called purity testing) is used.

Roadmap. The remainder of the paper is structured as follows. In Sect. 2, we give some details on the standard notation and well-known facts that are used throughout. In Sect. 3, we formally define quantum message authentication in terms of correctness and security. Section 4 gives the Clifford and trap schemes, while in Sect. 5 we show security of the schemes.

2 Preliminaries

Here, we present basic notation (Sect. 2.1) and well-known facts about the Pauli (Sect. 2.2) and Clifford (Sect. 2.3) groups.

2.1 Basic Notation

We assume the reader is familiar with the basics of quantum information [15], but nevertheless give a quick review of the most relevant notation in this section. We will use the density operator formalism to represent quantum states. Density matrices are represented with a greek letter, typically \(\rho \). The subscripts of the quantum states indicate which spaces (registers) the states reside in. We therefore represent the density operator for the state in the M register as \(\rho _M\).

The trace norm of a state, \(\rho \), denoted \(\left\| \rho \right\| _1\), is defined as \(\left\| \rho \right\| _1=tr[\sqrt{\rho ^{\dagger }\rho }]\). The trace distance between two states \(\rho \) and \(\sigma \), denoted \(D(\rho , \sigma )\), is defined as \(D(\rho ,\sigma )=\frac{1}{2}\left\| \rho -\sigma \right\| _1\). The trace distance is a measure of distiguishability between the two states \(\rho \) and \(\sigma \). The trace distance is equal to 0 if and only if \(\rho \) and \(\sigma \) are the same state (and therefore indistinguishable) and the trace distance is equal to 1 if and only if \(\rho \) and \(\sigma \) are orthogonal (and therefore perfectly distinguishable). The trace norm, and therefore the trace distance, satisfies the triangle inequality: \(\left\| \rho +\sigma \right\| _1 \le \left\| \rho \right\| _1 + \left\| \sigma \right\| _1\).

Let \({\mathcal {B}}({\mathcal {H}})\) be the space of bounded linear operators acting on a Hilbert space, \({\mathcal {H}}\). Given \({\mathcal {A}} \subseteq {\mathcal {B}}({\mathcal {H}}_1)\) and \({\mathcal {B}} \subseteq {\mathcal {B}}({\mathcal {H}}_2)\) then given a linear map T from \({\mathcal {A}} \rightarrow {\mathcal {B}}\), T is called positive if \(T(A) \ge 0\) for all positive \(A \in {\mathcal {A}}\). T is a completely positive map, (CP map), if \(T \otimes Id: {\mathcal {A}} \otimes {\mathcal {B}} \rightarrow {\mathcal {B}}({\mathcal {H}}_1) \otimes {\mathcal {B}}({\mathbb {C}}^n)\) is positive for all \(n \in {\mathbb {N}}\). In this case, Id is the identity map on \({\mathcal {B}}({\mathbb {C}}^n)\) and \({\mathbb {C}}^n\) is isomorphic to a complex Hilbert space of dimension n. A map, T, is trace preserving if \(tr(T(\rho ))=tr(\rho )\). T is a quantum channel if it is a completely positive and trace preserving map (CPTP map). A family of quantum maps is polynomial-time if they can be written as a polynomial-time uniform family of quantum circuits. A quantum state is polynomial-time generated if it given as the output of a polynomial-time quantum map (which takes as input the all-zeros state) [17].

A permutation map, denoted throughout by \(\pi \), is a unitary operation that acts on n qubits and permutes the order of the n qubits. This can equivalently be seen as a permutation, \(\sigma \), of the indices of the qubits, where \(\pi \) would take the \(i^{th}\) qubit to the \(\sigma (i)^{th}\) position. Permutation maps are orthogonal, real valued matrices so \(\pi ^{-1}=\pi ^{\dagger }\). We use \(\varPi _{n}\) to denote the set of all permutation maps on n qubits.

We denote a two-qubit maximally entangled pure state as \(|{\varPhi ^{+}}\rangle =\frac{1}{\sqrt{2}}(|{00}\rangle +|{11}\rangle )\). This is one of four Bell states. The other three Bell states are also maximally entangled pure states, \(|{\varPhi ^{-}}\rangle =\frac{1}{\sqrt{2}}(|{00}\rangle -|{11}\rangle )\), \(|{\varPsi ^{+}}\rangle =\frac{1}{\sqrt{2}}(|{01}\rangle +|{10}\rangle )\), and \(|{\varPsi ^{-}}\rangle =\frac{1}{\sqrt{2}}(|{01}\rangle -|{10}\rangle )\). The four Bell states are orthogonal and form a basis for two-qubit states. The four Bell states are therefore perfectly distinguishable and so we can perform a projective measurement into the Bell basis and determine which of the four Bell states we have. This is called a Bell basis measurement.

An [[n, 1, d]]-code is a quantum error correcting code that encodes one logical qubit into n qubits and has distance d; if \(d=2t+1\), the code can correct up to t bit or phase flips. We assume that the decoding map can always be applied, but if more than t errors are present, it is not guaranteed to decode to the original input.

2.2 Pauli Matrices

The single-qubit Pauli matrices are given by:

$$\begin{aligned} I=\begin{bmatrix} 1&0\\ 0&1 \end{bmatrix}, X=\begin{bmatrix} 0&1 \\ 1&0 \end{bmatrix}, Z=\begin{bmatrix} 1&0\\ 0&-1 \end{bmatrix}, \text { and } Y=iXZ=\begin{bmatrix} 0&-i \\ i&0 \end{bmatrix}. \end{aligned}$$
(1)

Recall that if we allow complex coefficients, the any single-qubit gate can be written as a linear combination of the four single-qubit Pauli matrices.

An n-qubit Pauli matrix is given by the n-fold tensor product of single-qubit Paulis. We denote the set of all n-qubit Pauli matrices by \({\mathbb {P}}_n\), where \(\left| {\mathbb {P}}_n\right| =4^n\). Any n-qubit unitary operator, U, can also be written as a linear combination of n-qubit Paulis, again allowing for complex coefficients. This gives \(U= \sum _{P \in {\mathbb {P}}_n} \alpha _P P\), with \(\sum _{P \in {\mathbb {P}}_n}|\alpha _P|^2 =1\), since U is unitary. This is called the Pauli decomposition of a unitary quantum operation.

The Pauli weight of an n-qubit Pauli, denoted \(\omega (P)\), is the number of non-identity Paulis in the n-fold tensor product. We will also define sets of Paulis composed only of specific Pauli matrices, such as \(\{I,X\}^{\otimes n}\) which is the set of all n-qubit Paulis composed of only I and X Paulis, or \(\{I,Z\}^{\otimes n}\) which is the set of all n-qubit Paulis composed of only I and Z Paulis. Finally, Paulis are self-inverses, so \(P=P^{-1}=P^{\dagger }\).

The following lemma, called the Pauli Twirl [10], shows how we can greatly simplify expressions that involve the twirling of an operation by the Pauli matrices:

Lemma 2.1

(Pauli Twirl). Let \(P, P'\) be Pauli operators. Then for any \(\rho \) it holds that:

$$\begin{aligned} \frac{1}{\left| {\mathbb {P}}_{n}\right| }\sum _{Q \in {\mathbb {P}}_n} Q^{\dagger } P Q \rho Q^{\dagger } P'^{\dagger } Q = {\left\{ \begin{array}{ll} 0, \text { }P \ne P' \\ P\rho P^{\dagger }, \text {otherwise}\,.\end{array}\right. } \end{aligned}$$

2.3 Clifford Group

The Clifford group, \({\mathcal {C}}_n\), on n qubits are unitaries that map Pauli matrices to Pauli matrices (up to a phase of \(\pm 1\) or \(\pm i\)). Specifically, if \(P \in {\mathbb {P}}_n\), then for all \(C \in {\mathcal {C}}_n\), \(\alpha CPC^{\dagger } \in {\mathbb {P}}_n\), for some \(\alpha \in \{ \pm 1, \pm i \}\). Not only do Cliffords map Paulis to Paulis, but they do so with a uniform distribution [1]:

Lemma 2.2

(Clifford Randomization). Let P be a non-identity Pauli operator. Applying a random Clifford operator (by conjugation) maps it to a Pauli operator chosen uniformly over all non-identity Pauli operators. More formally, for every P, Q \(\in {\mathbb {P}}_n \setminus \{ {\mathbb {I}} \}\), it holds that:

$$\begin{aligned} \left| \{ C \in {\mathcal {C}}_n | C^{\dagger }PC=Q\}\right| =\frac{\left| {\mathcal {C}}_n\right| }{\left| {\mathbb {P}}_n\right| -1}. \end{aligned}$$

We also state a lemma that is analogous to the Pauli twirl, the Clifford Twirl [10].

Lemma 2.3

(Clifford Twirl). Let \(P\ne P'\) be Pauli operators. For any \(\rho \) it holds that:

$$\begin{aligned} \sum \limits _{C \in {\mathcal {C}}_n} C^{\dagger }PC \rho C^{\dagger }P'C =0. \end{aligned}$$

Finally, we note that sampling a uniformly random Clifford can be done efficiently [13].

3 Quantum Message Authentication

Following [11], we define a quantum message authentication scheme as a pair of encoding and decoding maps that satisfy the following:

Definition 1

(Quantum Message Authentication Scheme). A quantum message authentication scheme is a polynomial-time set of encoding and decoding channels \(\{({\mathcal {E}}_k^{M\rightarrow C},{\mathcal {D}}_k^{C\rightarrow MF}) \mid k \in {\mathcal {K}}\}\), where \({\mathcal {K}}\) is the set of possible keys, \(M\) is the input system, \(C\) is the encoded system, and \(F\) is a flag system that is spanned by two orthogonal states: \(|{\text {acc}}\rangle \) and \(|{\text {rej}}\rangle \), such that for all \(\rho _M\), \(({\mathcal {D}}_k \circ {\mathcal {E}}_k)(\rho _M)=\rho _M\otimes |{\text {acc}}\rangle \langle {\text {acc}}|\).

In order to define security for a quantum message authentication scheme, we first consider a reference system \(R\), so that the input can be described as \(\rho _{MR}\) and we can furthermore assume that the system consisting of the encoded message, together with the reference system, undergoes a unitary adversarial attack \(U_{CR}\). For a fixed key, k, we thus define the real-world channel as:

$$\begin{aligned} {{\mathscr {E}}_k}^{MR\rightarrow MRF}: \rho _{MR} \mapsto ({\mathcal {D}}_{k}\otimes {\mathbb {I}}_R)(U_{CR} ({\mathcal {E}}_{k} \otimes {\mathbb {I}}_R)(\rho _{MR})U_{CR}^{\dagger }), \end{aligned}$$
(2)

where \({\mathbb {I}}_R\) is the identity map on the reference system, R. From now on, we will not include the identity maps, since it will be clear from context which system undergoes a linear map and which one does not.

Security is given in terms of the existence of a simulator, which has access only to the ideal functionality. This ideal functionality either accepts (and leaves the message register \(M\) intact), or rejects (and outputs a fixed state \(\varOmega _{M}\)); the simulator can interact with the ideal functionality by selecting accept or reject. In both cases, the simulator can also alter the reference system \(R\). This ideal-world process is modeled by the quantum channel \({\mathscr {F}}\), called the ideal channel, where for each attack, \(U_{CR}\), there exists two CP maps \({\mathscr {U}}^{acc}\) and \({\mathscr {U}}^{rej}\) acting only on the reference system \(R\) such that \({\mathscr {U}}^{acc}+{\mathscr {U}}^{rej}={\mathbbm {1}}\):

$$\begin{aligned}&{\mathscr {F}}^{MR\rightarrow MRF}: \rho _{MR} \rightarrow ({\mathbbm {1}}_M \otimes {\mathscr {U}}^{acc}_R)\rho _{MR} \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\qquad + tr_{M}(({\mathbbm {1}}_M \otimes {\mathscr {U}}^{rej}_R)\rho _{MR}) \varOmega _{M}\otimes |{\text {rej}}\rangle \langle {\text {rej}}|. \end{aligned}$$
(3)

Definition 2

(Security of Quantum Message Authentication). Let \(\{({\mathcal {E}}_k^{M\rightarrow C},{\mathcal {D}}_k^{C\rightarrow MF}) \mid k \in {\mathcal {K}}\}\) be a quantum message authentication scheme, with keys k chosen from \({\mathcal {K}}\). Then the scheme is \(\epsilon \)-secure if for all attacks, there exists a simulator such that:

$$\begin{aligned} D\Big (\frac{1}{\left| {\mathcal {K}}\right| }\sum _{k \in {\mathcal {K}}}{\mathscr {E}}_k(\rho _{MR}), {\mathscr {F}}(\rho _{MR})\Big ) \le \epsilon , \forall \rho _{MR}. \end{aligned}$$
(4)

Furthermore, we require that if \({\mathscr {E}}_k\) is polynomial-time in the size of the input register \(M\), then \({\mathscr {F}}\) is also polynomial-time in the size of the input register, \(M\).

We note that this definition is similar to the definition in [11]; however we require a polynomial-time simulation whenever the attack is polynomial-time. This does not limit the proof to polynomial-time attacks, but merely restricts the simulator to have at most the complexity of the attack. This condition being satisfied is typically a crucial ingredient in order for the composability to carry through [16].

4 Quantum Message Authentication Schemes

Here, we present two quantum message authentication schemes, the Clifford code (Sect. 4.1) and the trap code (Sect. 4.2). The two encoding procedures both proceed by appending trap qubits (in a fixed state) to the message register, and then twirling by a Clifford (for the Clifford code) or a Pauli (for the trap code). The trap code also has a permutation in addition to the Pauli twirl acting on the message register. Decoding simply consists of undoing the permutation in the trap code and then in both cases measuring the traps to check for any sign of tampering. In the case of the Clifford code, only one set of traps (all in the same state) is needed because the Clifford twirl breaks any Pauli attack into a uniform mixture of Paulis which is detected on the traps with high probability. The trap code, however, relies on two sets of traps (in two different states) with both a Pauli twirl and a permutation of the message and trap qubits. Furthermore, the trap scheme requires that we first encode the input message into an error correcting code (essentially, this is because the Pauli twirl is not as powerful as the Clifford twirl and will catch only high-weight Pauli attacks with the error correcting code taking care of the low-weight ones).

4.1 The Clifford Code

We define a message authentication scheme using a Clifford encryption as follows:

  1. 1.

    The encoding, \({\mathcal {E}}_k^{M \rightarrow C}\), takes as input an n-qubit message in the M system; it appends an additional d-qubit trap register in the state \(|{0}\rangle \langle {0}|^{\otimes d}\). A uniformly random Clifford is then applied to the resulting \(n+d\)-qubit register, according to the key, k. The output register is called C.

    Mathematically, the encoding, \({\mathcal {E}}_{k}^{M\rightarrow C}\), indexed by a secret key, k, on input \(\rho _{M}\) (where \(C_k\) the \(k^{\text {th}}\) Clifford) is given by:

    $$\begin{aligned} {\mathcal {E}}_{k}: \rho _{M} \mapsto C_{k} (\rho _{M} \otimes |{0}\rangle \langle {0}|^{\otimes d})C_{k}^{\dagger }. \end{aligned}$$
    (5)
  2. 2.

    The decoding, \({\mathcal {D}}_k^{C \rightarrow MF}\), takes the C register and applies the inverse Clifford, according to the key, k. The last d qubits are then measured in the computational basis. If this measurement returns \(|{0}\rangle \langle {0}|^{\otimes d}\) then an additional qubit \(|{\text {acc}}\rangle \langle {\text {acc}}|\) is appended in the flag system, F. If the measurements return anything else, then the remaining system, M, is traced out and replaced with a fixed n-qubit state, \(\varOmega _M\), and an additional qubit, \(|{\text {rej}}\rangle \langle {\text {rej}}|\), is appended in the flag system.

    Mathematically, the decoding, \({\mathcal {D}}_{k}^{C\rightarrow MF}\), also indexed by the secret key, k, is given by:

    $$\begin{aligned}&{\mathcal {D}}_{k} : \rho _{C} \mapsto tr_{0}({\mathcal {P}}_{acc}C_{k}^{\dagger }(\rho _{C})C_{k}{\mathcal {P}}_{acc}^{\dagger })\otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\qquad + tr_{M,0}({\mathcal {P}}_{rej} C_{k}^{\dagger }(\rho _{C})C_{k} {\mathcal {P}}_{rej}^{\dagger })\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|, \end{aligned}$$
    (6)

    where \({\mathcal {P}}_{acc}= {\mathbbm {1}}^{\otimes n} \otimes |{0}\rangle \langle {0}|^{\otimes d}\) and \({\mathcal {P}}_{rej}= {\mathbbm {1}}^{\otimes (n+d)}-{\mathcal {P}}_{acc}\) are measurement projectors representing the trap qubits being in their initial states or altered, respectively. Finally, \(tr_{0}\) refers to the trace over the d trap qubits.

4.2 The Trap Code

We define a trap code message authentication scheme as follows:

  1. 1.

    The encoding, \({\mathcal {E}}_k^{M \rightarrow C}\), takes as input \(\rho _{M}\) and applies an [[n, 1, d]]-error correcting code to the single-qubit M register, which will correct up to t errors (where \(d=2t+1\)). It then appends two additional n-qubit trap registers, the first in the state \(|{0}\rangle \langle {0}|^{\otimes n}\) and the second in the state \(|{+}\rangle \langle {+}|^{\otimes n}\). The resulting 3n-qubit register is then permuted and a Pauli encryption is applied, according to the key, k. The resulting register is called C.

    Mathematically the encoding, \({\mathcal {E}}_{k}^{M\rightarrow C}\), indexed by a two-part secret key \(k=(k_1, k_2)\) is given by:

    $$\begin{aligned} {\mathcal {E}}_{k}: \rho _{M} \mapsto P_{k_2}\pi _{k_1}(Enc_M(\rho _{M}) \otimes |{0}\rangle \langle {0}|^{\otimes n} \otimes |{+}\rangle \langle {+}|^{\otimes n})\pi _{k_1}^{\dagger }P_{k_2}, \end{aligned}$$
    (7)

    where \(Enc_M(\rho _{M})\) represents the input state after the error correcting code has been applied to the M system, \(\pi _{k_1}\) is the \(k_1^{th}\) permutation and \(P_{k_2}\) is the \(k_2^{th}\) Pauli matrix.

    We note that we use the error-correcting properties of the code only (it is sufficient in our context to simply correct low-weight Paulis on the message, as opposed detecting them and rejecting).

  2. 2.

    The decoding, \({\mathcal {D}}_k^{C \rightarrow MF}\), takes the C register and applies the inverse Pauli and then the inverse permutation according to the key, k. The last n qubits are then measured in the Hadamard basis and the second last n qubits are measured in the computational basis. If these two measurements return \(|{+}\rangle \langle {+}|^{\otimes n}\) and \(|{0}\rangle \langle {0}|^{\otimes n}\) respectively, then an additional qubit \(|{\text {acc}}\rangle \langle {\text {acc}}|\) is appended in the flag system F and the resulting M register is decoded (according to the error correcting code applied in the encoding). If the measurements return anything else, then the remaining system M is traced out and replaced with a fixed single-qubit state \(\varOmega _M\) and an additional qubit, \(|{\text {rej}}\rangle \langle {\text {rej}}|\), is appended in the flag system.

    Define \({\mathbb {P}}_{{\mathscr {E}}}= \{ P \otimes R \otimes Q | P \in {\mathbb {P}}_{n}, R \in \{I,Z\}^{\otimes n}, Q \in \{I,X\}^{\otimes n} \}\). Then define the measurement projector corresponding to the protocol accepting as \({\mathcal {P}}_{acc}= {\mathbbm {1}}^{\otimes n} \otimes |{0}\rangle \langle {0}|^{\otimes n} \otimes |{+}\rangle \langle {+}|^{\otimes n}\). The accepted states are then the states that can be achieved by applying any \(P \in {\mathbb {P}}_{{\mathscr {E}}}\) to \(\rho _M \otimes |{0}\rangle \langle {0}|^{\otimes n} \otimes |{+}\rangle \langle {+}|^{\otimes n}\). We define \({\mathcal {P}}_{rej}= {\mathbbm {1}}^{\otimes 3n}-{\mathcal {P}}_{acc}\), the measurement projector corresponding to the protocol rejecting, where the states achieved by applying any \(P \in {\mathbb {P}}_{3n} \setminus {\mathbb {P}}_{{\mathscr {E}}}\) to \(Enc_M(\rho _M) \otimes |{0}\rangle \langle {0}|^{\otimes n} \otimes |{+}\rangle \langle {+}|^{\otimes n}\) are rejected.

    Mathematically, the decoding, \({\mathcal {D}}_{k}^{C\rightarrow MF}\), also indexed by the two-part secret key, k, is given by:

    $$\begin{aligned}&{\mathcal {D}}_{k} : \rho _{C} \mapsto Dec_M tr_{0,+}({\mathcal {P}}_{acc}\pi ^{\dagger }_{k_1}P_{k_2}(\rho _{C})P_{k_2}\pi _{k_1}{\mathcal {P}}_{acc}^{\dagger })\otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\qquad + tr_{M,0,+}({\mathcal {P}}_{rej} \pi ^{\dagger }_{k_1}P_{k_2}(\rho _{C})P_{k_2} \pi _{k_1}{\mathcal {P}}_{acc}^{\dagger })\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|, \end{aligned}$$
    (8)

    where \(Dec_M\) is the decoding of the error correcting code applied in the encryption and \(tr_{0,+}\) refers to the trace over the last two sets of n trap qubits.

5 Security of Quantum Message Authentication Schemes

In this section, we present simulation-based proofs for the Clifford (Sect. 5.1) and the trap (Sect. 5.2) codes. At a high level, the security of the two codes is analyzed in very similar ways (see the discussion in Sect. 1). The main idea (in both cases) is to use a simulator that replaces the encoded message in \(C\) with half EPR pairs, without encryption in the Clifford code, and with only a permutation in the trap code; the attack is then applied to these half EPR pairs, as well as any reference system \(R\). From there we are able to compare the accepted and rejected states between the real world and ideal protocols in order to find the upper bound for the trace distance between them. We will notice that these differences are the cases where the real world protocol accepts something that the simulator rejects. Specifically, this is where an attack gets through and changes a logical qubit but is not detected in the traps. Of course, these same states are not rejected by the real world protocol but they are rejected by the simulator. Because the Clifford twirl maps any non-identity Pauli attack to a uniform mixture of non-identity Paulis, the bound for this distance is simple to compute in the case of the Clifford code. In the case of the trap code, a more complicated argument is needed based on permuting the attack and a combinatorial argument that bounds the undetected attacks that can alter the logical data.

5.1 Security of the Clifford Code

Simulator. Recall (Sect. 3) that the simulator interacts with the ideal functionality by only altering the reference system and selecting either accept or reject. Given the attack, \(U_{CR}\), to which the simulator has access, the simulator will apply the attack to half EPR pairs in place of the C system and then perform a Bell basis measurement on the EPR pairs. It will select accept if the EPR pairs are still in their original state, and reject otherwise. Let \({\mathcal {P}}_{acc}^{{\mathscr {U}}}={\mathbbm {1}}_{MR} \otimes |{\varPhi ^{+}}\rangle \langle {\varPhi ^{+}}|^{\otimes (n+d)}_{C_1C_2}\) and \({\mathcal {P}}_{rej}^{{\mathscr {U}}}={\mathbbm {1}} - {\mathcal {P}}_{acc}^{{\mathscr {U}}}\). The ideal channel is then:

$$\begin{aligned}&{\mathscr {F}}^{MR\rightarrow MRF}: \rho _{MR}\rightarrow \nonumber \\&\quad tr_{C_1C_2} ({\mathcal {P}}_{acc}^{{\mathscr {U}}}U_{C_1R}(\rho _{MR} \otimes |{\varPhi ^{+}}\rangle \langle {\varPhi ^{+}}|^{\otimes (n+d)}_{C_1C_2})U_{C_1R}^{\dagger }{\mathcal {P}}_{acc}^{{\mathscr {U}}\dagger }) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\qquad + tr_{M}(tr_{C_1C_2} ({\mathcal {P}}_{rej}^{{\mathscr {U}}}U_{C_1R}(\rho _{MR} \otimes |{\varPhi ^{+}}\rangle \langle {\varPhi ^{+}}|^{\otimes (n+d)}_{C_1C_2}) \nonumber \\&\qquad U_{C_1R}^{\dagger }{\mathcal {P}}_{rej}^{{\mathscr {U}}\dagger })) \varOmega _{M}\otimes |{\text {rej}}\rangle \langle {\text {rej}}|. \end{aligned}$$
(9)

According to the above, we define \({\mathscr {U}}^{acc}\) and \({\mathscr {U}}^{rej}\) that satisfy Eq. (3) as:

$$\begin{aligned} {\mathscr {U}}^{acc}: \rho _{R} \rightarrow tr_{C_1C_2} ({\mathcal {P}}_{acc}^{{\mathscr {U}}}U_{C_1R}(\rho _{R} \otimes |{\varPhi ^{+}}\rangle \langle {\varPhi ^{+}}|^{\otimes (n+d)}_{C_1C_2})U_{C_1R}^{\dagger }{\mathcal {P}}_{acc}^{{\mathscr {U}}\dagger }), \end{aligned}$$
(10)

and

$$\begin{aligned} {\mathscr {U}}^{rej}: \rho _{R} \rightarrow tr_{C_1C_2} ({\mathcal {P}}_{rej}^{{\mathscr {U}}}U_{C_1R}(\rho _{R} \otimes |{\varPhi ^{+}}\rangle \langle {\varPhi ^{+}}|^{\otimes (n+d)}_{C_1C_2})U_{C_1R}^{\dagger }{\mathcal {P}}_{rej}^{{\mathscr {U}}\dagger }). \end{aligned}$$
(11)

For a fixed attack \(U_{CR} = \sum \limits _{P \in {\mathbb {P}}_{n+d}}\alpha _P P_C \otimes U_R^P\), with \(\sum \limits _{P \in {\mathbb {P}}_{n+d}} \left| \alpha _P\right| ^2=1\), we note the effects of \({\mathscr {U}}^{acc}\) and \({\mathscr {U}}^{rej}\), recalling, of course, that \({\mathscr {U}}^{acc}(\rho _{MR})\) is understood to be \(({\mathbbm {1}}_{M}\otimes {\mathscr {U}}^{acc})(\rho _{MR})\), with the same understanding for \({\mathscr {U}}^{rej}\):

$$\begin{aligned} {\mathscr {U}}^{acc}(\rho _{MR})&= tr_{C_1C_2} ({\mathcal {P}}_{acc}^{{\mathscr {U}}}U_{C_1R} (\rho _{MR} \otimes |{\varPhi ^{+}}\rangle \langle {\varPhi ^{+}}|^{\otimes (n+d)}_{C_1C_2})U_{C_1R}^{\dagger }{\mathcal {P}}_{acc}^{{\mathscr {U}}\dagger }) \nonumber \\&= \left| \alpha _{{\mathbbm {1}}}\right| ^2 ({\mathbbm {1}}_M \otimes U_R^{{\mathbbm {1}}}) \rho _{MR} ({\mathbbm {1}}_M \otimes U_R^{{\mathbbm {1}}\dagger }) \end{aligned}$$
(12)
$$\begin{aligned} {\mathscr {U}}^{rej}(\rho _{MR})&= tr_{C_1C_2} ({\mathcal {P}}_{rej}^{{\mathscr {U}}} \Big (\sum \limits _{P\ne {\mathbbm {1}}}\left| \alpha _P\right| ^2 P_{C_1} \otimes U_R^P \Big ) \nonumber \\&\qquad (\rho _{MR} \otimes |{\varPhi ^{+}}\rangle \langle {\varPhi ^{+}}|^{\otimes (n+d)}_{C_1C_2}) \Big (\sum \limits _{P\ne {\mathbbm {1}}}\left| \alpha _P\right| ^2 P_{C_1} \otimes U_R^{P\dagger } \Big ) {\mathcal {P}}_{rej}^{{\mathscr {U}}\dagger }) \nonumber \\&= \sum \limits _{P\ne {\mathbbm {1}}}\left| \alpha _P\right| ^2 ({\mathbbm {1}}_M \otimes U_R^P)(\rho _{MR})({\mathbbm {1}}_M \otimes U_R^{P\dagger }). \end{aligned}$$
(13)

We are now ready to state and prove our main theorem on the security of the Clifford message authentication scheme.

Theorem 5.1

Let \(\{({\mathcal {E}}_k^{S\rightarrow C},{\mathcal {D}}_k^{C\rightarrow SF}) \mid k \in {\mathcal {K}}\}\) be the Clifford quantum message authentication scheme, with parameter d. Then the Clifford code is an \(\epsilon \)-secure quantum authentication scheme, for \(\epsilon \le \frac{3}{2^d}\).

Proof

We will follow the proof structure used in [1, 11].

Using the simulator described above, we wish to show that:

$$\begin{aligned} D\Big ( \frac{1}{\left| {\mathcal {K}}\right| } \sum \limits _{k \in {\mathcal {K}}} {\mathscr {E}}_k(\rho _{MR}), {\mathscr {F}}(\rho _{MR}) \Big ) \le \epsilon , \forall \rho _{MR}. \end{aligned}$$
(14)

Consider a general attack \(U_{CR}\), written as \(U_{CR} = \sum \limits _{P \in {\mathbb {P}}_{n+d}}\alpha _P P_C \otimes U_R^P\) where \(\sum \limits _{P \in {\mathbb {P}}_{n+d}} \left| \alpha _P\right| ^2=1\). The real-world channel is then represented as:

$$\begin{aligned}&{{\mathscr {E}}_k}^{MR\rightarrow MRF}: \rho _{MR} \mapsto {\mathcal {D}}_{k}\Big (\Big (\sum \limits _{P \in {\mathbb {P}}_{n+d}}\alpha _P P_C \otimes U_R^P\Big ) {\mathcal {E}}_{k}(\rho _{MR}) \nonumber \\&\Big (\sum \limits _{P \in {\mathbb {P}}_{n+d}}\overline{\alpha _P} P_C \otimes U_R^{P\dagger }\Big )\Big ). \end{aligned}$$
(15)

We will use \(\psi =\rho _{MR} \otimes |{0}\rangle \langle {0}|^{\otimes d}\) to simplify the following expressions. Consider the effect of the real protocol on input \(\rho _{MR}\) with attack \(\sum \limits _{P \in {\mathbb {P}}_{n+d}}\alpha _P P_C \otimes U_R^P\), conditioned on acceptance:

$$\begin{aligned}&\frac{1}{\left| {\mathcal {K}}\right| }\sum \limits _{k \epsilon {\mathcal {K}}} tr_{0}\Big ({\mathcal {P}}_{acc}C_{k}^{\dagger }\Big (\sum \limits _{P \in {\mathbb {P}}_{n+d}}\alpha _P P_C \otimes U_R^P\Big )(C_{k}\psi C_{k}^{\dagger }) \nonumber \\&\quad \Big (\sum \limits _{P \in {\mathbb {P}}_{n+d}}\overline{\alpha _P}P_C^{\dagger } \otimes U_R^{P\dagger }\Big )C_{k} {\mathcal {P}}_{acc}^{\dagger }\Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|. \end{aligned}$$
(16)

Now we can apply the Clifford Twirl (Lemma 2.3), since the sum over all keys is, of course, the sum over all Cliffords (since the keys index all \(n+d\)-qubit Cliffords) and then simply split the sum over all Paulis into the case with the identity Pauli from the attack, and all other Paulis. What we are left with is:

$$\begin{aligned}&\frac{1}{\left| {\mathcal {K}}\right| }\sum \limits _{k \epsilon {\mathcal {K}}} tr_{0}\Big (\sum \limits _{P \in {\mathbb {P}}_{n+d}}\left| \alpha _P\right| ^2 {\mathcal {P}}_{acc}C_{k}^{\dagger }(P_C \otimes U_R^P)(C_{k}\psi C_{k}^{\dagger }) \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad (P_C^{\dagger } \otimes U_R^{P\dagger })C_{k} {\mathcal {P}}_{acc}^{\dagger }\Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&=\frac{1}{\left| {\mathcal {K}}\right| }\sum \limits _{k \epsilon {\mathcal {K}}} tr_{0}\Big (\left| \alpha _{{\mathbbm {1}}}\right| ^2 {\mathcal {P}}_{acc}C_{k}^{\dagger }({\mathbbm {1}}_C \otimes U_R^{{\mathbbm {1}}})(C_{k}\psi C_{k}^{\dagger }) \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad ({\mathbbm {1}}_C \otimes U_R^{{\mathbbm {1}} \dagger })C_{k} {\mathcal {P}}_{acc}^{\dagger }\Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\quad +\frac{1}{\left| {\mathcal {K}}\right| }\sum \limits _{k \epsilon {\mathcal {K}}} tr_{0}\Big (\sum \limits _{P\ne {\mathbbm {1}}}\left| \alpha _P\right| ^2{\mathcal {P}}_{acc}C_{k}^{\dagger }(P_C \otimes U_R^P)(C_{k}\psi C_{k}^{\dagger }) \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad (P_C^{\dagger } \otimes U_R^{P\dagger })C_{k} {\mathcal {P}}_{acc}^{\dagger }\Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|. \end{aligned}$$
(17)

Clearly the first term is exactly what the simulator will accept, and the second term is in exactly the right form to use a Clifford Randomization (Lemma 2.2), resulting in:

$$\begin{aligned}&={\mathscr {U}}^{acc}(\rho _{MR}) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\quad + \frac{1}{\left| {\mathcal {C}}_n\right| } tr_{0}\Big (\sum \limits _{\tilde{P} \ne {\mathbbm {1}}}\sum \limits _{P\ne {\mathbbm {1}}} \left| \alpha _P\right| ^2 \frac{\left| {\mathcal {C}}_n\right| }{\left| {\mathbb {P}}_n\right| -1} {\mathcal {P}}_{acc}(\tilde{P}_C \otimes U_R^P)\psi \nonumber \\&\quad \quad (\tilde{P}_C^{\dagger } \otimes U_R^{P\dagger }){\mathcal {P}}_{acc}^{\dagger }\Big )\otimes |{\text {acc}}\rangle \langle {\text {acc}}|. \end{aligned}$$
(18)

The \(\tilde{P}\)s are the results of the Clifford Randomization applied to a Pauli, P. The randomization is not applied to the reference system, so the \(U_R^P\) terms are not changed by the randomization. We can use the properties of the trace to move the trace inside the first sum, and we can move the \(\frac{\left| {\mathcal {C}}_n\right| }{\left| {\mathbb {P}}_n\right| -1}\) coefficient out of both of the sums:

$$\begin{aligned}&={\mathscr {U}}^{acc}(\rho _{MR}) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\qquad + \frac{1}{\left| {\mathcal {C}}_n\right| } \frac{\left| {\mathcal {C}}_n\right| }{\left| {\mathbb {P}}_n\right| -1} \Big ( \sum \limits _{\tilde{P} \ne {\mathbbm {1}}} tr_{0} \sum \limits _{P\ne {\mathbbm {1}}} \left| \alpha _P\right| ^2 {\mathcal {P}}_{acc}(\tilde{P}_C \otimes U_R^P)\psi \nonumber \\&\qquad (\tilde{P}_C^{\dagger } \otimes U_R^{P\dagger }){\mathcal {P}}_{acc}^{\dagger }\Big )\otimes |{\text {acc}}\rangle \langle {\text {acc}}|. \end{aligned}$$
(19)

We recognize the R register in the second sum as the states that the simulator will reject. Recall that the simulator is in terms of the sum over all non-identity Paulis and includes the \(\alpha _P\) coefficients. We can therefore write the previous line in terms of the simulator as:

$$\begin{aligned}&={\mathscr {U}}^{acc}(\rho _{MR}) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\qquad + \frac{1}{\left| {\mathbb {P}}_{n+d}\right| -1}\Big (\sum \limits _{\tilde{P}\ne {\mathbbm {1}}} tr_{0} {\mathcal {P}}_{acc}(\tilde{P}_C ({\mathscr {U}}^{rej}(\rho _{MR}) \nonumber \\&\qquad \otimes |{0}\rangle \langle {0}|^{\otimes d}) \tilde{P}_C^{\dagger }) {\mathcal {P}}_{acc}^{\dagger }\Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|. \end{aligned}$$
(20)

If we let \({\mathbb {P}}_t\) be the set of all Paulis that do not alter the trap qubits, then when we apply \({\mathcal {P}}_{acc}\) to the above, we end up with the sum over the \(\tilde{P} \in {\mathbb {P}}_t \setminus \{ {\mathbbm {1}} \}\). Therefore the previous line can be simplified to:

$$\begin{aligned}&={\mathscr {U}}^{acc}(\rho _{MR}) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\qquad + \frac{1}{\left| {\mathbb {P}}_{n+d}\right| -1}\sum \limits _{\tilde{P} \in {\mathbb {P}}_t \setminus {\mathbbm {1}}}tr_{0}(\tilde{P}_C ({\mathscr {U}}^{rej}(\rho _{MR}) \otimes |{0}\rangle \langle {0}|^{\otimes d})\tilde{P}_C^{\dagger })\otimes |{\text {acc}}\rangle \langle {\text {acc}}|.\nonumber \\ \end{aligned}$$
(21)

The effect of the real protocol on input \(\rho _{MR}\) with attack \(\sum \limits _{P \in {\mathbb {P}}_{n+d}}\alpha _P P_C \otimes U_R^P\), conditioned on rejection, can be manipulated in the same way:

$$\begin{aligned}&\frac{1}{\left| {\mathcal {K}}\right| }\sum \limits _{k \epsilon {\mathcal {K}}}\Big ( tr_{M,0}\Big ({\mathcal {P}}_{rej}{\mathcal {C}}_{k}^{\dagger }\Big (\sum \limits _{P\in {\mathbb {P}}_{n+d}}\alpha _P P_C \otimes U_R^P\Big )(C_{k}(\psi )C_{k}^{\dagger }) \nonumber \\&\qquad \qquad \qquad \qquad \quad \Big (\sum \limits _{P \in {\mathbb {P}}_{n+d}} \overline{\alpha _P} P_C^{\dagger } \otimes U_R^{P\dagger }\Big )C_{k} {\mathcal {P}}_{rej}^{\dagger }\Big )\Big )\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\nonumber \\&=\frac{1}{\left| {\mathcal {K}}\right| }\sum \limits _{k \epsilon {\mathcal {K}}} \Big (tr_{M,0}(\left| \alpha _{{\mathbbm {1}}}\right| ^2 {\mathcal {P}}_{rej}C_{k}^{\dagger }({\mathbbm {1}}_C \otimes U_R^{{\mathbbm {1}}})(C_{k}(\psi )C_{k}^{\dagger }) \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \quad ({\mathbbm {1}}_C \otimes U_R^{{\mathbbm {1}} \dagger })C_{k} {\mathcal {P}}_{rej}^{\dagger })\Big )\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\nonumber \\&\quad + \frac{1}{\left| {\mathcal {K}}\right| }\sum \limits _{k \epsilon {\mathcal {K}}} \Big (tr_{M,0}\Big (\sum \limits _{P\ne {\mathbbm {1}}}\left| \alpha _P\right| ^2 {\mathcal {P}}_{rej}C_{k}^{\dagger }(P_C \otimes U_R^P)(C_{k}(\psi )C_{k}^{\dagger }) \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad { } (P_C^{\dagger } \otimes U_R^{P\dagger })C_{k} {\mathcal {P}}_{rej}^{\dagger }\Big )\Big )\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\nonumber \\&= \frac{1}{\left| {\mathbb {P}}_{n+d}\right| -1} \sum \limits _{\tilde{P} \ne {\mathbbm {1}}} \sum \limits _{P \ne {\mathbbm {1}}} \left| \alpha \right| ^2 \Big (tr_{M,0}({\mathcal {P}}_{acc}( \tilde{P}_C \otimes U_R^P)(\psi ) \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad (\tilde{P}_C^{\dagger } \otimes U_R^{P\dagger }){\mathcal {P}}_{acc}^{\dagger })\Big )\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\nonumber \\&=tr_M({\mathscr {U}}^{rej}(\rho _{MR}))\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\nonumber \\&\qquad \qquad \qquad \qquad -\frac{1}{\left| {\mathbb {P}}_{n+d}\right| -1} tr_M \Big (\sum \limits _{P \in {\mathbb {P}}_t \setminus {\mathbbm {1}}} {\mathscr {U}}^{rej}(\rho _{MR})\Big ) \varOmega _M |{\text {rej}}\rangle \langle {\text {rej}}|\nonumber \\&= tr_M({\mathscr {U}}^{rej}(\rho _{MR}))\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\nonumber \\&\qquad \qquad \qquad \qquad -\frac{4^n2^d-1}{\left| {\mathbb {P}}_{n+d}\right| -1} tr_M({\mathscr {U}}^{rej}(\rho _{MR}))\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|. \end{aligned}$$
(22)

When we combine the accepted states and the rejected states into the real world protocol given by Eq. (15), we can write it in terms of the simulator as:

$$\begin{aligned} {\mathcal {D}}&_k(U_{CR} {\mathcal {E}}_k (\rho _{MR}) U_{CR}^{\dagger }) \nonumber \\ =&{\mathscr {U}}^{acc}(\rho _{MR}) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&+ \frac{1}{\left| {\mathbb {P}}_{n+d}\right| -1}\sum \limits _{\tilde{P} \in {\mathbb {P}}_t \setminus {\mathbbm {1}}}tr_{0}(\tilde{P}_C ({\mathscr {U}}^{rej}(\rho _{MR}) \otimes |{0}\rangle \langle {0}|^{\otimes d})\tilde{P}_C^{\dagger })\otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&+ tr_M({\mathscr {U}}^{rej}(\rho _{MR}))\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\nonumber \\&-\frac{4^n2^d-1}{\left| {\mathbb {P}}_{n+d}\right| -1} tr_M({\mathscr {U}}^{rej}(\rho _{MR}))\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|. \end{aligned}$$
(23)

We can therefore write Eq. (14) as:

$$\begin{aligned}&\frac{1}{2}\Big ||{\mathscr {U}}^{acc}(\rho _{MR}) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\qquad + \frac{1}{\left| {\mathbb {P}}_{n+d}\right| -1}\sum \limits _{\tilde{P} \in {\mathbb {P}}_t \setminus {\mathbbm {1}}}tr_{0}(\tilde{P}_C ({\mathscr {U}}^{rej}(\rho _{MR}) \otimes |{0}\rangle \langle {0}|^{\otimes d})\tilde{P}_C^{\dagger })\otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\qquad + tr_M({\mathscr {U}}^{rej}(\rho _{MR}))\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\nonumber \\&\qquad -\frac{4^n2^d-1}{\left| {\mathbb {P}}_{n+d}\right| -1} tr_M({\mathscr {U}}^{rej}(\rho _{MR}))\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\nonumber \\&\qquad - ({\mathscr {U}}^{acc}(\rho _{MR}) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|+ tr_M({\mathscr {U}}^{rej}(\rho _{MR}))\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|) \Big ||_{1}\nonumber \\&\quad =\frac{1}{2}\Big ||\frac{1}{\left| {\mathbb {P}}_{n+d}\right| -1}\sum \limits _{\tilde{P} \in {\mathbb {P}}_t \setminus {\mathbbm {1}}}tr_{0}(\tilde{P}_C ({\mathscr {U}}^{rej}(\rho _{MR}) \otimes |{0}\rangle \langle {0}|^{\otimes d})\tilde{P}_C^{\dagger })\otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\qquad - \frac{4^n2^d-1}{\left| {\mathbb {P}}_{n+d}\right| -1} tr_M({\mathscr {U}}^{rej}(\rho _{MR}))\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\Big ||_{1} \end{aligned}$$
(24)

Since \(\left| {\mathbb {P}}_t \setminus {\mathbbm {1}}\right| =4^n2^d-1\), and the maximum trace distance between two states is 1, we can see that by the triangle inequality, the above is bounded by:

$$\begin{aligned}&\le \frac{4^n2^d-1}{\left| {\mathbb {P}}_{n+d}\right| -1} \nonumber \\&= \frac{4^n2^d-1}{4^{n+d}-1} = \frac{1 - \frac{1}{4^n2^d}}{2^d - \frac{1}{4^n2^d}} \nonumber \\&\le 3 \times \frac{1}{2^d}. \end{aligned}$$
(25)

This concludes the proof, showing that the Clifford code is \(\frac{3}{2^d}\)-secure.    \(\square \)

This is identical to the bound of \(\frac{6}{2^d}\) achieved in [11] when we consider that we use the trace distance in our definition of security, and [11] uses the trace norm, which differs from the trace distance by a factor of 2.

5.2 Security of the Trap Code

Simulator. Recall (Sect. 3) that the simulator interacts with the ideal functionality by only altering the reference system and selecting either accept or reject. Given the attack, \(U_{CR}\), to which the simulator has access, the simulator will apply the attack to randomly permuted half EPR pairs in place of the C system and then de-permute the EPR pairs and perform a Bell basis measurement. It will select accept if the first n of the EPR pairs have \(\le t\) errors, the next n of the EPR pairs are either unchanged or have phase flip errors, and the last n of the EPR pairs are either unchanged or have bit flip errors. It will select reject otherwise. Let \({\mathbb {P}}_{{\mathscr {F}}}=\{ P \otimes R \otimes Q | P \in {\mathbb {P}}_{n}, \omega (P) \le t, R \in \{I,Z\}^{\otimes n}, Q \in \{I,X\}^{\otimes n} \} \). Specifically, \({\mathbb {P}}_{{\mathscr {F}}}\) is the set of all Paulis that the ideal protocol will accept being applied to the half EPR pair—Paulis that would apply at most t non-identity Paulis on the message space and would not alter the \(|{0}\rangle \langle {0}|^{\otimes n}\) or the \(|{+}\rangle \langle {+}|^{\otimes n}\) traps in the real world protocol. Finally, define the measurement projector corresponding to the simulator selecting accept as:

$$\begin{aligned} {\mathcal {P}}_{acc}^{{\mathscr {U}}}&=\sum \limits _{Q \in \{I,X\}^{\otimes n}} \sum \limits _{R \in \{I,Z\}^{\otimes n}}\sum \limits _{P \in {\mathbb {P}}_{n} \mid \omega (P) \le t} {\mathbbm {1}}_{MR} \otimes (P \otimes R \otimes Q)_{C_1} \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad |{\varPhi ^{+}}\rangle \langle {\varPhi ^{+}}|_{C_1C_2}^{\otimes 3n} (P \otimes R \otimes Q)_{C_1} \nonumber \\&=\sum _{P \in {\mathbb {P}}_{{\mathscr {F}}}} {\mathbbm {1}}_{MR} \otimes (P_{C_1} |{\varPhi ^{+}}\rangle \langle {\varPhi ^{+}}|_{C_1C_2}^{\otimes 3n}P_{C_1}^\dag ), \end{aligned}$$
(26)

and the measurement projector corresponding to the simulator selecting reject as:

$$\begin{aligned} {\mathcal {P}}_{rej}^{{\mathscr {U}}}={\mathbbm {1}} - {\mathcal {P}}_{acc}^{{\mathscr {U}}}. \end{aligned}$$
(27)

The ideal channel with attack \(U_{C_1R}\) is therefore:

$$\begin{aligned}&{\mathscr {F}}^{MR\rightarrow MRF}: \rho _{MR} \rightarrow tr_{C_1C_2} \frac{1}{\left| \varPi _{3n}\right| }\sum _{\pi \in \varPi _{3n}} \Big ({\mathcal {P}}_{acc}^{{\mathscr {U}}} \pi ^\dagger _{C_1} U_{C_1R} \pi _{C_1} \nonumber \\&\qquad \qquad \qquad \qquad (\rho _{MR} \otimes |{\varPhi ^{+}}\rangle \langle {\varPhi ^{+}}|^{\otimes 3n}_{C_1C_2}) \pi _{C_1}^{\dagger } U_{C_1R}^{\dagger } \pi _{C_1} {\mathcal {P}}_{acc}^{{\mathscr {U}}\dagger }\Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\qquad + tr_{M}\Big (tr_{C_1C_2} \frac{1}{\left| \varPi _{3n}\right| } \sum _{\pi \in \varPi _{3n}} \Big ({\mathcal {P}}_{rej}^{{\mathscr {U}}} \pi _{C_1}^{\dagger } U_{C_1R} \pi _{C_1} (\rho _{MR} \otimes |{\varPhi ^{+}}\rangle \langle {\varPhi ^{+}}|^{\otimes 3n}_{C_1C_2}) \nonumber \\&\quad \quad \quad \quad \quad \quad \quad \quad \quad \!\!\!\! \pi ^\dagger _{C_1} U_{C_1R}^{\dagger } \pi _{C_1} {\mathcal {P}}_{rej}^{{\mathscr {U}}\dagger }\Big )\Big ) \varOmega _{M}\otimes |{\text {rej}}\rangle \langle {\text {rej}}|. \end{aligned}$$
(28)

For a fixed attack \(U_{CR} = \sum \limits _{P \in {\mathbb {P}}_{3n}}\alpha _P P_C \otimes U_R^P\), with \(\sum \limits _{P \in {\mathbb {P}}_{3n}} \left| \alpha _P\right| ^2 =1\) and where for the sake of brevity we will represent \(\rho _{MR} \otimes |{\varPhi ^{+}}\rangle \langle {\varPhi ^{+}}|^{\otimes 3n}_{C_1C_2}\) with \(\phi _{MRC_1C_2}\), the ideal channel becomes:

$$\begin{aligned}&{\mathscr {F}}^{MR\rightarrow MRF}: \rho _{MR} \rightarrow \nonumber \\&tr_{C_1C_2} \frac{1}{\left| \varPi _{3n}\right| }\sum _{\pi \in \varPi _{3n}} \Bigg ( {\mathcal {P}}_{acc}^{{\mathscr {U}}} \pi ^\dagger _{C_1} \Big ( \sum \limits _{P \in {\mathbb {P}}_{3n}} \alpha _P P_{C_1} \otimes U_R^{P} \Big ) \pi _{C_1} \phi _{MRC_1C_2} \nonumber \\&\qquad \qquad \qquad \qquad \qquad \pi _{C_1}^{\dagger } \Big ( \sum \limits _{P \in {\mathbb {P}}_{3n}} \overline{\alpha _P} P_{C_1} \otimes U_R^{P \dagger } \Big )\pi _{C_1} {\mathcal {P}}_{acc}^{{\mathscr {U}}\dagger } \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&+ tr_{M} \Big ({\mathcal {P}}_{rej}^{{\mathscr {U}}} \pi _{C_1}^{\dagger } \Big ( \sum \limits _{P \in {\mathbb {P}}_{3n}} \alpha _P P_{C_1} \otimes U_R^{P} \Big ) \pi _{C_1} \phi _{MRC_1C_2} \nonumber \\&\qquad \qquad \pi ^\dagger _{C_1} \Big ( \sum \limits _{P \in {\mathbb {P}}_{3n}} \overline{\alpha _P} P_{C_1} \otimes U_R^{P \dagger } \Big ) \pi _{C_1} {\mathcal {P}}_{rej}^{{\mathscr {U}}\dagger }\Big ) \varOmega _{M}\otimes |{\text {rej}}\rangle \langle {\text {rej}}|\Bigg ). \end{aligned}$$
(29)

From here we will move the permutations to act on the attack Paulis, since they’re all applied to the same register, \(C_1\):

$$\begin{aligned} =&tr_{C_1C_2}\frac{1}{\left| \varPi _{3n}\right| } \sum _{\pi \in \varPi _{3n}}\Bigg ( \Big ({\mathcal {P}}_{acc}^{{\mathscr {U}}} \Big ( \sum \limits _{P \in {\mathbb {P}}_{3n}} \alpha _P \pi ^\dagger _{C_1} P_{C_1} \pi _{C_1} \otimes U_R^{P} \Big ) \phi _{MRC_1C_2} \nonumber \\&\qquad \qquad \qquad \qquad \Big ( \sum \limits _{P \in {\mathbb {P}}_{3n}} \overline{\alpha _P} \pi _{C_1}^{\dagger } P_{C_1} \pi _{C_1} \otimes U_R^{P \dagger } \Big ){\mathcal {P}}_{acc}^{{\mathscr {U}}\dagger }\Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&+ tr_{M} \Big ({\mathcal {P}}_{rej}^{{\mathscr {U}}} \Big ( \sum \limits _{P \in {\mathbb {P}}_{3n}} \alpha _P \pi ^{\dagger }_{C_1}P_{C_1} \pi _{C_1}\otimes U_R^{P} \Big ) \phi _{MRC_1C_2} \nonumber \\&\qquad \Big ( \sum \limits _{P \in {\mathbb {P}}_{3n}} \overline{\alpha _P} \pi ^\dagger _{C_1} P_{C_1} \pi _{C_1}\otimes U_R^{P \dagger } \Big ) {\mathcal {P}}_{rej}^{{\mathscr {U}}\dagger }\Big ) \varOmega _{M}\otimes |{\text {rej}}\rangle \langle {\text {rej}}|\Bigg ). \end{aligned}$$
(30)

Finally we apply the projectors:

$$\begin{aligned}&=tr_{C_1C_2} \frac{1}{\left| \varPi _{3n}\right| }\sum _{\pi \in \varPi _{3n}}\Bigg ( \Big ( \sum \limits _{P | \pi ^{\dagger }P \pi \in {\mathbb {P}}_{{\mathscr {F}}}} \left| \alpha _P\right| ^2 (\pi ^\dagger _{C_1} P_{C_1} \pi _{C_1} \otimes U_R^{P})(\phi _{MRC_1C_2}) \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad (\pi _{C_1}^{\dagger } P_{C_1} \pi _{C_1} \otimes U_R^{P \dagger }) \Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\quad + tr_{M} \Big ( \sum \limits _{P | \pi ^{\dagger } P \pi \notin {\mathbb {P}}_{{\mathscr {F}}}} \left| \alpha _P\right| ^2 (\pi ^{\dagger }_{C_1}P_{C_1} \pi _{C_1}\otimes U_R^{P}) (\phi _{MRC_1C_2}) \nonumber \\&\qquad (\pi ^\dagger _{C_1} P_{C_1} \pi _{C_1}\otimes U_R^{P \dagger }) \Big ) \varOmega _{M}\otimes |{\text {rej}}\rangle \langle {\text {rej}}|\Bigg ). \end{aligned}$$
(31)

We are now ready to present our main theorem on the security of the trap code:

Theorem 5.2

Let \(\{({\mathcal {E}}_k^{S\rightarrow C},{\mathcal {D}}_k^{C\rightarrow SF}) \mid k \in {\mathcal {K}}\}\) be the trap quantum message authentication scheme with parameter t, the number of bit or phase flip errors that the error correcting code applied to the input message qubit can correct. Then the trap code is an \(\epsilon \)-secure quantum message authentication scheme, for \(\epsilon \le (\frac{1}{3})^{t+1}\).

Proof

Using the simulator described above, we wish to show that:

$$\begin{aligned} D \Big (\frac{1}{\left| {\mathcal {K}}\right| } \sum \limits _{k \in {\mathcal {K}}} {\mathscr {E}}_k(\rho _{MR}),{\mathscr {F}}(\rho _{MR}) \Big ) \le \epsilon , \forall \rho _{MR}. \end{aligned}$$
(32)

Consider a general attack \(U_{CR}\), written as \(U_{CR} = \sum \limits _{P \in {\mathbb {P}}_{3n}}\alpha _P P_C \otimes U_R^P\) with \(\sum \limits _{P \in {\mathbb {P}}_{3n}} \left| \alpha _P\right| ^2=1\). Let \(\psi = Enc_M (\rho _{MR} ) \otimes |{0}\rangle \langle {0}|^{\otimes n} \otimes |{+}\rangle \langle {+}|^{\otimes n}\). The real-world channel is then represented as:

$$\begin{aligned}&{{\mathscr {E}}_k}^{MR\rightarrow MRF}: \rho _{MR} \mapsto {\mathcal {D}}_{k}\Big (\Big (\sum \limits _{P \in {\mathbb {P}}_{3n}}\alpha _P P_C \otimes U_R^P\Big ) {\mathcal {E}}_{k}(\rho _{MR}) \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \Big (\sum \limits _{P \in {\mathbb {P}}_{3n}}\overline{\alpha _P} P_C \otimes U_R^{P\dagger }\Big )\Big ) \end{aligned}$$
(33)
$$\begin{aligned}&= \frac{1}{\left| {\mathcal {K}}\right| } tr_{0,+} \sum \limits _{k \epsilon {\mathcal {K}}}\Bigg (Dec_M\Big ({\mathcal {P}}_{acc}\pi ^{\dagger }_{k_1}P_{k_2}\Big (\sum \limits _{P \in {\mathbb {P}}_{3n}}\alpha _P P_C \otimes U_R^P\Big )P_{k_2}\pi _{k_1}\psi \nonumber \\&\qquad \qquad \qquad \quad \pi _{k_1}^{\dagger }P_{k_2}\Big (\sum \limits _{P \in {\mathbb {P}}_{3n}}\overline{\alpha _P} P_C \otimes U_R^{P\dagger }\Big )P_{k_2} \pi _{k_1} {\mathcal {P}}_{acc}^{\dagger }\Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\quad + tr_{M}\Big ({\mathcal {P}}_{rej}\pi ^{\dagger }_{k_1}P_{k_2}\Big (\sum \limits _{P \in {\mathbb {P}}_{3n}}\alpha _P P_C \otimes U_R^P\Big )(P_{k_2}\pi _{k_1} \psi \pi _{k_1}^{\dagger }P_{k_2}) \nonumber \\&\qquad \qquad \Big (\sum \limits _{P \in {\mathbb {P}}_{3n}}\overline{\alpha _P} P_C \otimes U_R^{P\dagger }\Big )P_{k_2}\pi _{k_1} {\mathcal {P}}_{rej}^{\dagger }\Big ) \varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\Bigg ). \end{aligned}$$
(34)

From here we apply the Pauli Twirl (Lemma 2.1):

$$\begin{aligned}&= \frac{1}{\left| {\mathcal {K}}_1\right| } tr_{0,+} \sum \limits _{k_1 \epsilon {\mathcal {K}}_1}\Bigg (Dec_M \Big ({\mathcal {P}}_{acc}\pi ^{\dagger }_{k_1}\Big (\sum \limits _{P \in {\mathbb {P}}_{3n}}\left| \alpha _P\right| ^2 (P_C \otimes U_R^P)\pi _{k_1} \psi \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \pi _{k_1}^{\dagger }(P_C \otimes U_R^{P\dagger })\Big ) \pi _{k_1} {\mathcal {P}}_{acc}^{\dagger }\Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\quad + tr_{M}\Big ({\mathcal {P}}_{rej}\pi ^{\dagger }_{k_1}\Big (\sum \limits _{P \in {\mathbb {P}}_{3n}}\left| \alpha _P\right| ^2 (P_C \otimes U_R^P)\pi _{k_1} \psi \nonumber \\&\qquad \qquad \qquad \qquad \pi _{k_1}^{\dagger }(P_C \otimes U_R^{P\dagger })\Big )\pi _{k_1} {\mathcal {P}}_{rej}^{\dagger }\Big ) \varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\Bigg ). \end{aligned}$$
(35)

Since the permutations act on the same register as the attack Paulis, we can move the permutations to be considered to be acting on the Paulis instead of the message and traps:

$$\begin{aligned}&= \frac{1}{\left| {\mathcal {K}}_1\right| }tr_{0,+}\sum \limits _{k_1 \epsilon {\mathcal {K}}_1}\Bigg ( Dec_M \Big ({\mathcal {P}}_{acc}\Big (\sum \limits _{P \in {\mathbb {P}}_{3n}}\left| \alpha _P\right| ^2 (\pi _{k_1}^{\dagger }P_C \pi _{k_1}\otimes U_R^P) \psi \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad (\pi _{k_1}^{\dagger }P_C \pi _{k_1} \otimes U_R^{P\dagger })\Big ) {\mathcal {P}}_{acc}^{\dagger }\Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\quad +tr_{M}\Big ({\mathcal {P}}_{rej}\Big (\sum \limits _{P \in {\mathbb {P}}_{3n}}\left| \alpha _P\right| ^2 (\pi ^{\dagger }_{k_1}P_C\pi _{k_1} \otimes U_R^P) \psi \nonumber \\&\qquad \qquad \qquad \qquad (\pi _{k_1}^{\dagger }P_C \pi _{k_1} \otimes U_R^{P\dagger })\Big ){\mathcal {P}}_{rej}^{\dagger }\Big ) \varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\Bigg ). \end{aligned}$$
(36)

Finally we apply the projectors and notice that \({\mathcal {K}}_1 = \varPi _{3n}\):

$$\begin{aligned}&= \frac{1}{\left| \varPi _{3n}\right| }tr_{0,+}\sum \limits _{\pi \epsilon \varPi _{3n}}\Bigg (Dec_M\Big (\sum \limits _{P | \pi ^{\dagger }P\pi \in {\mathbb {P}}_{{\mathscr {E}}}}\left| \alpha _P\right| ^2 (\pi ^{\dagger }P_C \pi \otimes U_R^P)\psi \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad (\pi ^{\dagger }P_C \pi \otimes U_R^{P\dagger })\Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\quad + tr_{M} \Big (\sum \limits _{P | \pi ^{\dagger } P \pi \in {\mathbb {P}}_{3n}\setminus {\mathbb {P}}_{{\mathscr {E}}}} \left| \alpha _P\right| ^2 (\pi ^{\dagger }P_C\pi \otimes U_R^P)\psi \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad (\pi ^{\dagger }P_C \pi \otimes U_R^{P\dagger })\Big )\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\Bigg ). \end{aligned}$$
(37)

Then:

$$\begin{aligned}&\frac{1}{2} \Big ||\frac{1}{\left| {\mathcal {K}}\right| }\sum \limits _{k \in {\mathcal {K}}} {\mathscr {E}}_k(\rho _{MR}) - {\mathscr {F}}(\rho _{MR}) \Big ||_{1} \nonumber \\&= \frac{1}{2} \Big ||\frac{1}{\left| \varPi _{3n}\right| }\sum \limits _{\pi \epsilon \varPi _{3n}}\Bigg ( tr_{0,+}\Big (Dec_M\Big (\sum \limits _{P | \pi ^{\dagger }P\pi \in {\mathbb {P}}_{{\mathscr {E}}}}\left| \alpha _P\right| ^2 (\pi ^{\dagger }P_C \pi \otimes U_R^P)\psi \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad (\pi ^{\dagger }P_C \pi \otimes U_R^{P\dagger })\Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\quad + tr_{M} \Big (\sum \limits _{P | \pi ^{\dagger } P \pi \in {\mathbb {P}}_{3n}\setminus {\mathbb {P}}_{{\mathscr {E}}}} \left| \alpha _P\right| ^2 (\pi ^{\dagger }P_C\pi \otimes U_R^P)\psi \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad (\pi ^{\dagger }P_C \pi \otimes U_R^{P\dagger })\Big )\varOmega _M \otimes |{\text {rej}}\rangle \langle {\text {rej}}|\Big ) \nonumber \\&\quad - tr_{C_1C_2} \Big ( \sum \limits _{P | \pi ^{\dagger }P \pi \in {\mathbb {P}}_{{\mathscr {F}}}} \left| \alpha _P\right| ^2 (\pi ^\dagger _{C_1} P_{C_1} \pi _{C_1} \otimes U_R^{P})(\phi _{MRC_1C_2}) \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad (\pi _{C_1}^{\dagger } P_{C_1} \pi _{C_1} \otimes U_R^{P \dagger }) \Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\quad - tr_{MC_1C_2} \Big ( \sum \limits _{P | \pi ^{\dagger } P \pi \notin {\mathbb {P}}_{{\mathscr {F}}}} \left| \alpha _P\right| ^2 (\pi ^{\dagger }_{C_1}P_{C_1} \pi _{C_1}\otimes U_R^{P}) (\phi _{MRC_1C_2}) \nonumber \\&\qquad \qquad \qquad \qquad (\pi ^\dagger _{C_1} P_{C_1} \pi _{C_1}\otimes U_R^{P \dagger }) \Big ) \varOmega _{M}\otimes |{\text {rej}}\rangle \langle {\text {rej}}|\Bigg ) \Big ||_{1}. \end{aligned}$$
(38)

We will subtract the accepted states in the ideal protocol from those accepted in the real protocol and we will subtract the rejected states in the real protocol from the rejected states in the ideal protocol. Note that \({\mathbb {P}}_{{\mathscr {E}}}\setminus {\mathbb {P}}_{{\mathscr {F}}}=\{P \otimes R \otimes Q | P \in {\mathbb {P}}_{n}, \omega (P)>t, R \in \{I,Z\}^{\otimes n}, Q \in \{I,X\}^{\otimes n} \}\).

$$\begin{aligned}&= \frac{1}{2} \Big ||\frac{1}{\left| \varPi _{3n}\right| }\sum \limits _{\pi \epsilon \varPi _{3n}} \sum \limits _{P | \pi ^{\dagger }P\pi \in {\mathbb {P}}_{{\mathscr {E}}}\setminus {\mathbb {P}}_{{\mathscr {F}}}} \Bigg ( tr_{0,+} \Big ( Dec_M (\left| \alpha _P\right| ^2 (\pi ^{\dagger }P_C \pi \otimes U_R^P)\psi \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad (\pi ^{\dagger }P_C \pi \otimes U_R^{P\dagger }))\Big )\otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\quad - tr_{MC_1C_2} \Big ( \left| \alpha _P\right| ^2 (\pi ^{\dagger }_{C_1}P_{C_1} \pi _{C_1}\otimes U_R^{P}) (\phi _{MRC_1C_2}) \nonumber \\&\qquad \qquad \qquad \qquad (\pi ^\dagger _{C_1} P_{C_1} \pi _{C_1}\otimes U_R^{P \dagger }) \Big ) \varOmega _{M}\otimes |{\text {rej}}\rangle \langle {\text {rej}}|\Bigg ) \Big ||_{1}. \end{aligned}$$
(39)

Here we will use the triangle inequality to remove the sums from the trace distance:

$$\begin{aligned}&\le \frac{1}{2} \frac{1}{\left| \varPi _{3n}\right| }\sum \limits _{\pi \in \varPi _{3n}} \sum \limits _{P | \pi ^{\dagger }P\pi \in {\mathbb {P}}_{{\mathscr {E}}}\setminus {\mathbb {P}}_{{\mathscr {F}}}} \Big ||tr_{0,+} \Big ( Dec_M (\left| \alpha _P\right| ^2 (\pi ^{\dagger }P_C \pi \otimes U_R^P)\psi \nonumber \\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \quad (\pi ^{\dagger }P_C \pi \otimes U_R^{P\dagger }))\Big ) \otimes |{\text {acc}}\rangle \langle {\text {acc}}|\nonumber \\&\quad - tr_{MC_1C_2} \Big (\left| \alpha _P\right| ^2 (\pi ^{\dagger }_{C_1}P_{C_1} \pi _{C_1}\otimes U_R^{P}) (\phi _{MRC_1C_2}) \nonumber \\&\qquad \qquad \qquad \qquad \qquad (\pi ^\dagger _{C_1} P_{C_1} \pi _{C_1}\otimes U_R^{P \dagger }) \Big ) \varOmega _{M}\otimes |{\text {rej}}\rangle \langle {\text {rej}}|\Big ||_{1}. \end{aligned}$$
(40)

Since the maximum trace distance between two states is 1 we have:

$$\begin{aligned}&\le \frac{1}{\left| \varPi _{3n}\right| }\sum \limits _{k_1 \epsilon {\mathcal {K}}_1} \sum \limits _{P | \pi ^{\dagger }P\pi \in {\mathbb {P}}_{{\mathscr {E}}}\setminus {\mathbb {P}}_{{\mathscr {F}}}} \left| \alpha _P\right| ^2. \end{aligned}$$
(41)

Now if we let \(\eta _P\) be the number of permutations, \(\pi \) of P such that \(\pi ^{\dagger }P\pi \in {\mathbb {P}}_{{\mathscr {E}}}\setminus {\mathbb {P}}_{{\mathscr {F}}}\), then the above can be written as:

$$\begin{aligned}&= \frac{1}{\left| \varPi _{3n}\right| } \sum \limits _{P \in {\mathbb {P}}_{3n}} \eta _P \times \left| \alpha _P\right| ^2. \end{aligned}$$
(42)

In Appendix A, we give Lemma A.1, which gives us \(\eta _P \le {n \atopwithdelims ()t+1}(t+1)! (3n-(t+1))!\). Thus, since \(\sum \limits _{P \in {\mathbb {P}}_{3n}}\left| \alpha _P\right| ^2=1\), the above expression can be bounded by:

$$\begin{aligned}&\le \frac{1}{(3n)!} \times {n \atopwithdelims ()t+1}(t+1)! (3n-(t+1))! \nonumber \\&= \frac{\prod \limits _{i=1}^{n}i \prod \limits _{i=1}^{3n-t-1}i}{\prod \limits _{i=1}^{n-t-1}i \prod \limits _{i=1}^{3n}i} = \frac{\prod \limits _{i=n-t}^{n}i }{\prod \limits _{i=3n-t}^{3n}i} = \prod \limits _{i=0}^{t} \frac{ n-t+i}{3n-t+i} \nonumber \\&\le \prod \limits _{i=0}^{t} \frac{1}{3} = \Big (\frac{1}{3}\Big )^{t+1} \end{aligned}$$
(43)

Therefore, \(D \Big (\frac{1}{\left| {\mathcal {K}}\right| } \sum \limits _{k \in {\mathcal {K}}} {\mathscr {E}}_k(\rho _{MR}), {\mathscr {F}}(\rho _{MR}) \Big ) \le (\frac{1}{3})^{t+1}, \forall \rho _{MR}\).    \(\square \)

We note that this is very similar to the bound in [5] of \((\frac{2}{3})^{d/2}\): note that the trap code in [5] uses the error detection property of the code. Since a code of distance d can detect up to d / 2 errors, this bound is consistent with our bound of \((\frac{1}{3})^{t+1}\).