In this section, we introduce a protocol model for describing not only our dihedral cards but also other cards. Roughly speaking, a card-based protocol can be specified by a deck of cards and a set of operations. Thus in order to describe a new type of cards, we must define a suitable deck of cards and a suitable set of operations. In this section, we explain the model with the case of the standard binary cards
in order to make it easier to read for those who are familiar with the ordinary card-based cryptography. We give definitions for dihedral cards in Sect. 3. We also give definitions for other cards in Appendix.
Deck, Sequence, and Visible Sequence
In Mizuki-Shizuya model, a deck is defined by a finite multiset. For example, \({\mathcal {D}}= \{\clubsuit , \clubsuit , \clubsuit , \heartsuit , \heartsuit , \heartsuit \}\) denotes a deck consists of six cards: three clubs and three hearts. All backsides are assumed to be “\(\varvec{?}\)”. (Thus, it is required the condition that \({\mathcal {D}}\cap \{\varvec{?}\} = \emptyset \).) Although it captures some class of decks including decks of binary cards
and number cards
, it is not sufficient if non-standard cards (like dihedral cards) are used.
In our model, we define a deck as follows:
Definition 1
(Deck) A deck \({\overline{\mathcal{D}}}\) is defined by a five-tuple as follows:
$$\begin{aligned} {\overline{\mathcal{D}}} := ({\mathcal {C}}, {\mathcal {T}}, \varSigma , \mathsf {vis}, {\mathcal {D}}), \end{aligned}$$
where \({\mathcal {C}}\) is a finite set called a card set, \({\mathcal {T}}\subset \{t \mid {t}: {\mathcal {C}}\rightarrow {\mathcal {C}}\}\) is called a transformation set, \(\varSigma \) is a finite set called a symbol set, \(\mathsf {vis}: {\mathcal {C}}\rightarrow \varSigma \) is a function called a vision function, and \({\mathcal {D}}\) is a finite multiset called a deck set, where the base set is \({\mathcal {C}}\). We assume that \({\mathcal {T}}\) always contains the identity function \(\mathsf {id}: {\mathcal {C}}\rightarrow {\mathcal {C}}\). The former four-tuple \(({\mathcal {C}}, {\mathcal {T}}, \varSigma , \mathsf {vis})\) is called a card specification. \(\blacksquare \)
Example 1
Consider a deck of cards
whose back sides are
, which is used by the Five-Card Trick [2]. The deck is described by the following:
-
The card set is \({\mathcal {C}}= \{\clubsuit /\varvec{?}, \heartsuit /\varvec{?}, \varvec{?}/\clubsuit , \varvec{?}/\heartsuit \}\);
-
The symbol set is \(\varSigma = \{\clubsuit , \heartsuit , \varvec{?}\}\);
-
The transformation set is \({\mathcal {T}}= \{\mathsf {id}, \mathsf {turn}\}\), where the function \(\mathsf {turn}\) is defined by \(\mathsf {turn}(X/Y) = Y/X\) for any \(X, Y \in \varSigma \);
-
The vision function \(\mathsf {vis}\) is defined by \(\mathsf {vis}(X/Y) = X\) for any \(X, Y \in \varSigma \);
-
The deck set is \({\mathcal {D}}= \{\clubsuit /\varvec{?}, \clubsuit /\varvec{?}, \heartsuit /\varvec{?}, \heartsuit /\varvec{?}, \heartsuit /\varvec{?}\} = \{(\clubsuit /\varvec{?})^2, (\heartsuit /\varvec{?})^3\}\).
For the card set \({\mathcal {C}}\), the element “\(\,\clubsuit /\varvec{?}\)” (resp. “\(\,\heartsuit /\varvec{?}\)”) means a face-up card
(resp.
) and the element “\(\,\varvec{?}/\clubsuit \)” (resp. “\(\,\varvec{?}/\heartsuit \)”) means a face-down card
whose front side is
(resp.
). The transformation set has a turning transformation \(\mathsf {turn}\). By applying \(\mathsf {turn}\) to a card, a face-up card is changed to a face-down card (and vice versa). The vision function specifies what information is revealed from a card. From face-up cards “\(\,\clubsuit /\varvec{?}\)” and “\(\,\heartsuit /\varvec{?}\)”, it reveals the symbols “\(\,\clubsuit \)” and “\(\,\heartsuit \)”, on the other hand, from face-down cards “\(\,\varvec{?}/\clubsuit \)” and “\(\,\varvec{?}/\heartsuit \)”, it reveals “\(\,\varvec{?}\)” only. This card specification \(({\mathcal {C}}, {\mathcal {T}}, \varSigma , \mathsf {vis})\) is called the binary cards. Hereafter, we denote the binary cards by \(\mathsf {Binary}= ({\mathcal {C}}^\mathsf{b}, {\mathcal {T}}^\mathsf{b}, \varSigma ^\mathsf{b}, \mathsf {vis}^\mathsf{b})\). \(\blacksquare \)
Sequence We define a sequence as follows:
Definition 2
(Sequence) Let \(\overline{\mathcal{D}}= ({\mathcal {C}}, {\mathcal {T}}, \varSigma , \mathsf {vis}, {\mathcal {D}})\) be a deck. A sequence s in \(\overline{\mathcal{D}}\) is defined as follows:
$$\begin{aligned} s = (t_1(x_1), t_2(x_2), \ldots , t_{|{\mathcal {D}}|}(x_{|{\mathcal {D}}|})), \end{aligned}$$
where \(t_1, t_2, \ldots , t_{|{\mathcal {D}}|} \in {\mathcal {T}}\) and \({\mathcal {D}}= \{x_1, x_2, \ldots , x_{|{\mathcal {D}}|}\}\) as a multiset. The set of all sequences in \(\overline{\mathcal{D}}\) is denoted by \(\mathsf {Seq}^{\overline{\mathcal{D}}}\). \(\blacksquare \)
Example 2
Let \(\overline{\mathcal{D}}= (\mathsf {Binary}, {\mathcal {D}})\) be the deck in Example 1. An example of a sequence s of \(\overline{\mathcal{D}}\) is as follows:
$$\begin{aligned} s = (\varvec{?}/\clubsuit , \varvec{?}/\heartsuit , \heartsuit /\varvec{?}, \varvec{?}/\heartsuit , \varvec{?}/\clubsuit ). \end{aligned}$$
This is because s is represented as follows:
$$\begin{aligned} s = (\mathsf {turn}(\clubsuit /\varvec{?}), \mathsf {turn}(\heartsuit /\varvec{?}), \mathsf {id}(\heartsuit /\varvec{?}), \mathsf {turn}(\heartsuit /\varvec{?}), \mathsf {turn}(\clubsuit /\varvec{?})). \end{aligned}$$
It represents a sequence
. \(\blacksquare \)
Visible sequence We define a visible sequence as follows:
Definition 3
(Visible sequence) Let \(\overline{\mathcal{D}}= ({\mathcal {C}}, {\mathcal {T}}, \varSigma , \mathsf {vis}, {\mathcal {D}})\) be a deck and let \(s = (x_1, x_2, \ldots , x_{|{\mathcal {D}}|}) \in \mathsf {Seq}^{\overline{\mathcal{D}}}\) be a sequence in \(\overline{\mathcal{D}}\). The visible sequence of s in \(\overline{\mathcal{D}}\) is defined as follows:
$$\begin{aligned} \mathsf {vis}(s) := (\mathsf {vis}(x_1), \mathsf {vis}(x_2), \ldots , \mathsf {vis}(x_{|{\mathcal {D}}|})). \end{aligned}$$
The set of all visible sequences in \(\overline{\mathcal{D}}\) is defined as follows:
$$\begin{aligned} \mathsf {Vis}^{\overline{\mathcal{D}}} = \{\mathsf {vis}(s) \mid s \in \mathsf {Seq}^{\overline{\mathcal{D}}}\}. \end{aligned}$$
\(\blacksquare \)
Example 3
Let s be the sequence in Example 2. The visible sequence of s is \(\mathsf {vis}(s) = (\varvec{?},\varvec{?},\heartsuit ,\varvec{?},\varvec{?})\). We sometimes write it by \((\varvec{?}^2,\heartsuit ,\varvec{?}^2)\) or \(\varvec{?}^2\heartsuit \varvec{?}^2\). \(\blacksquare \)
Operation
Let \(\overline{\mathcal{D}}\) be a deck. Let \(s \in \mathsf {Seq}^{\overline{\mathcal{D}}}\) be a sequence in \(\overline{\mathcal{D}}\). We consider two types of operations, conversion and opening, as follows:
-
Conversion: It converts s into a new sequence \(s' \in \mathsf {Seq}^{\overline{\mathcal{D}}}\). When it is deterministic, it is called a deterministic operation (e.g. permutation and turn). When it is randomized, it is called a probabilistic operation (e.g. shuffle).
-
Opening: It reveals some information on s when a visible sequence of the sequence is not changed (e.g. sign opening in Sect. 3.2).
Now we define the most standard set of operations (of conversion) for binary cards. Let \(\overline{\mathcal{D}}= (\mathsf {Binary}, {\mathcal {D}})\) be a deck of binary cards such that \(|{\mathcal {D}}| = \ell \) and let \(s = (c_1, c_2, \ldots , c_{\ell }) \in \mathsf {Seq}^{\overline{\mathcal{D}}}\) be a sequence in \(\overline{\mathcal{D}}\). We define three sets of operations, permutation, turning, and shuffle as follows:
Permutation For \(\pi \in S_{\ell }\) (here \(S_{\ell }\) denotes the \(\ell \)-th symmetric group), a permutation operation \((\mathsf {perm}, \pi )\) generates a new sequence in \(\overline{\mathcal{D}}\) as follows:
$$\begin{aligned} (c_1, c_2, \ldots , c_{\ell })~\rightarrow ~(c_{\pi ^{-1}(1)}, c_{\pi ^{-1}(2)}, \ldots , c_{\pi ^{-1}(\ell )}). \end{aligned}$$
That is, the card in the i-th position in s is moved to the \(\pi (i)\)-th position in the new sequence. The set of permutations \(\mathsf {Perm}_{\ell }\) for sequences of \(\ell \) cards is defined as follows:
$$\begin{aligned} \mathsf {Perm}_{\ell } := \{(\mathsf {perm}, \pi ) \mid \pi \in S_{\ell }\}. \end{aligned}$$
Turn For a set of positions \(T \subset [\ell ]\) (here \([\ell ]\) denotes the set \(\{1, 2, \ldots , \ell \}\)), a turning operation \((\mathsf {turn}, T)\) takes s as input and returns a new sequence \(s' \in \mathsf {Seq}^{\overline{\mathcal{D}}}\) as follows:
$$\begin{aligned} (c_1, c_2, \ldots , c_{\ell })~\rightarrow ~(c'_1, c'_2, \ldots , c'_{\ell }), \end{aligned}$$
where for \(i \in T\), it holds \(c'_i = \mathsf {turn}(c_i)\), where this “\(\mathsf {turn}\)” is a transformation (i.e., \(\mathsf {turn}\in {\mathcal {T}}^\mathsf{b}\)), and for \(i \not \in T\), it holds \(c'_i = c_i\). The set of turnings \(\mathsf {Turn}_{\ell }\) for sequences of \(\ell \) cards is defined as follows:
$$\begin{aligned} \mathsf {Turn}_{\ell } := \{(\mathsf {turn}, T) \mid T \subset [\ell ]\}. \end{aligned}$$
We note that a turning operation is not an opening but a conversion since it changes the view of a sequence. Opening is used for operations that do not change the view of a sequence.
Shuffle A shuffle operation is defined by a tuple \((\mathsf {shuffle}, \varPi , D)\), where \(\varPi \subset S_{\ell }\) is a subset of permutations and D is a probability distribution on \(\varPi \). It randomly generates a new sequence \(s' \in \mathsf {Seq}^{{\mathcal {D}}}\) as follows:
$$\begin{aligned} (c_1, c_2, \ldots , c_{\ell }) ~\rightarrow ~(c_{\pi ^{-1}(1)}, c_{\pi ^{-1}(2)}, \ldots , c_{\pi ^{-1}(\ell )}), \end{aligned}$$
where \(\pi \in \varPi \) is independently and randomly chosen according to D. The set of shuffles \(\mathsf {Shuf}_{\ell }\) for sequences of \(\ell \) cards is defined as follows:
$$\begin{aligned} \mathsf {Shuf}_{\ell } := \{(\mathsf {shuffle}, \varPi , D) \mid \varPi \subset S_{\ell }, D\text { is a distribution on }\varPi \}. \end{aligned}$$
View
Let \(\overline{\mathcal{D}}\) be a deck. Let \({\mathcal {O}}\) be a set of operations. For a sequence \(s \in \mathsf {Seq}^{\overline{\mathcal{D}}}\), an operation \(\mathsf{op}\in {\mathcal {O}}\) converts it into a new sequence \(s' \in \mathsf {Seq}^{\overline{\mathcal{D}}}\) with revealed information \(r \in \{0,1\}^*\) as follows:
$$\begin{aligned} s~\rightarrow ~s'~~~\hbox { revealed information}\ r, \end{aligned}$$
where if \(\mathsf{op}\) is conversion, revealed information is defined by \(r = \bot \), and if \(\mathsf{op}\) is opening, \(s'\) is identical to s. What is revealed from this process to the players? Before applying \(\mathsf{op}\), they observe a visible sequence \(\mathsf {vis}(s)\). After applying \(\mathsf{op}\), they observe a visible sequence \(\mathsf {vis}(s')\) and revealed information r. Thus, all information revealed from the above process is \((\mathsf {vis}(s), \mathsf {vis}(s'), r)\). See sign opening and value opening in Sect. 3.2 for concrete example of openings.
Suppose that a list of k operations \(\mathbf {\mathsf{op}} \in {\mathcal {O}}^k\) is applied to a sequence \(s_0\) as follows:
$$\begin{aligned} s_0~\rightarrow ~s_1~\rightarrow ~s_2~\rightarrow ~\cdots ~\rightarrow ~s_k. \end{aligned}$$
Assume that the i-th operation brings revealed information \(r_i \in \{0,1\}^*\). Then, all information revealed from the above process is given as follows:
$$\begin{aligned} (\mathsf {vis}(s_0), r_0)\rightarrow (\mathsf {vis}(s_1), r_1)\rightarrow (\mathsf {vis}(s_2), r_2)\rightarrow \cdots \rightarrow (\mathsf {vis}(s_k), r_k), \end{aligned}$$
where \(r_0 = \bot \) and \(r_i = \bot \) if the i-th operation is conversion. This is called a view of \(\mathbf {\mathsf{op}}\) starting with the sequence \(s_0\). The set of views \(\mathsf {View}^{\overline{\mathcal{D}}}\) is defined as follows:
$$\begin{aligned} \mathsf {View}^{\overline{\mathcal{D}}} = \left( \mathsf {Vis}^{\overline{\mathcal{D}}} \times \{0,1\}^* \right) ^*. \end{aligned}$$
Example 4
Let \(\overline{\mathcal{D}}= (\mathsf {Binary}, {\mathcal {D}})\) be the deck in Example 1. Let \({\mathcal {O}}\) be a set of operations \({\mathcal {O}}= \mathsf {Perm}_5 \cup \mathsf {Turn}_5\). Let \(\mathbf {\mathsf{op}}\) be a list of operations defined as follows:
$$\begin{aligned} \mathbf {\mathsf{op}} = \bigl ((\mathsf {perm}, (1\;2)), (\mathsf {turn}, \{1,2\}), (\mathsf {perm}, (1\;3))\bigr ). \end{aligned}$$
When it is applied to a sequence \(s_0 = (\varvec{?}/\clubsuit , \varvec{?}/\heartsuit , \varvec{?}/\clubsuit )\) as follows:
$$\begin{aligned} (\varvec{?}/\clubsuit , \varvec{?}/\heartsuit , \varvec{?}/\clubsuit )~\rightarrow ~(\varvec{?}/\heartsuit , \varvec{?}/\clubsuit , \varvec{?}/\clubsuit )~\rightarrow ~(\heartsuit /\varvec{?}, \clubsuit /\varvec{?}, \varvec{?}/\clubsuit )~\rightarrow ~(\varvec{?}/\clubsuit , \clubsuit /\varvec{?}, \heartsuit /\varvec{?}), \end{aligned}$$
a view of \(\mathbf {\mathsf{op}}\) starting with the sequence \(s_0\) is given as follows:
$$\begin{aligned} ((\varvec{?}, \varvec{?}, \varvec{?}), \bot )~\rightarrow ~((\varvec{?}, \varvec{?}, \varvec{?}), \bot )~\rightarrow ~((\heartsuit , \clubsuit , \varvec{?}), \bot )~\rightarrow ~((\varvec{?}, \clubsuit , \heartsuit ), \bot ). \end{aligned}$$
We sometimes omit revealed information it is clear that all operations are conversion as follows:
$$\begin{aligned} (\varvec{?}, \varvec{?}, \varvec{?})~\rightarrow ~(\varvec{?}, \varvec{?}, \varvec{?})~\rightarrow ~(\heartsuit , \clubsuit , \varvec{?})~\rightarrow ~(\varvec{?}, \clubsuit , \heartsuit ). \end{aligned}$$
We also write the above by \(\varvec{?}^3 \rightarrow \varvec{?}^3 \rightarrow \heartsuit \clubsuit \varvec{?}\rightarrow \varvec{?}\clubsuit \heartsuit \). \(\blacksquare \)
Protocol
Protocol We define a protocol as follows:
Definition 4
(Protocol) A protocol \({\mathcal {P}}\) is defined by a five-tuple as follows:
$$\begin{aligned} {\mathcal {P}}= (n, X, \overline{\mathcal{D}}, {\mathcal {O}}, A), \end{aligned}$$
where
-
\(n \in {\mathbb {N}}\) is any natural number called the number of inputs;
-
X is a finite set called an input domain;
-
\(\overline{\mathcal{D}}= ({\mathcal {C}}, {\mathcal {T}}, \varSigma , \mathsf {vis}, {\mathcal {D}})\) is a deck;
-
\({\mathcal {O}}\) is a finite set called an operation set;
-
\(A: \mathsf {View}^{\overline{\mathcal{D}}} \rightarrow {\mathcal {O}}\cup \{\bot \}\) is an action function.\(\blacksquare \)
Execution of a protocol Let \({\mathcal {P}}= (n, X, \overline{\mathcal{D}}, {\mathcal {O}}, A)\) be a protocol. Let \(s_0 \in \mathsf {Seq}^{\overline{\mathcal{D}}}\) be a sequence. An execution of \({\mathcal {P}}\) starting with \(s_0\) proceeds as follows:
-
1.
The initial sequence is set to \(s_0\) as follows:
Set \(s \leftarrow s_0\) and \(v \leftarrow (\mathsf {vis}(s_0), \bot )\), where s is a variable of the current sequence and v is a variable of the entire view of an execution.
-
2.
Compute the action function \(A(v) = \alpha \); if \(\alpha \ne \bot \), apply the operation \(\alpha \) to the sequence s; and obtain a new sequence \(s'\) with revealed information \(r \in \{0,1\}^*\); Set \(s \leftarrow s'\) and append “\(\rightarrow (\mathsf {vis}(s'), r)\)” to v; Repeat this step until it happens \(\alpha = \bot \).
-
3.
If \(A(v) = \bot \), terminate the execution.
Example 5
We describe a (slightly modified version of) six-card AND protocol by Mizuki and Sone [9] as follows:
$$\begin{aligned} (2, \{0,1\}, \overline{\mathcal{D}}, {\mathcal {O}}, A). \end{aligned}$$
The deck \(\overline{\mathcal{D}}\) is defined by \(\overline{\mathcal{D}}= (\mathsf {Binary}, \{(\clubsuit /\varvec{?})^3, (\heartsuit /\varvec{?})^3\})\). The operation set \({\mathcal {O}}\) is defined by \({\mathcal {O}}= \mathsf {Perm}_6 \cup \mathsf {Turn}_6 \cup \mathsf {Shuf}_6\). The action function A is defined by:
-
\(A(v_0) = (\mathsf {perm}, (2\;4\;3))\);
-
\(A(v_1) = (\mathsf {shuffle}, \varPi , D)\) where \(\varPi = \{\mathsf {id},(1\;4)(2\;5)(3\;6)\}\) and D is a uniform distribution over \(\varPi \);
-
\(A(v_2) = (\mathsf {perm}, (2\;4\;3)^{-1})\);
-
\(A(v_3) = (\mathsf {turn}, \{1,2\})\);
-
\(A(v_4) = (\mathsf {perm}, (1\;2) (3\;5) (4\;6))\);
-
\(A(v) = \bot \) for any \(v \not \in \{v_0, v_1, v_2, v_3, v_4\}\).
where
-
\(v_0 = (\varvec{?}^6, \bot )\);
-
\(v_1 = (\varvec{?}^6, \bot ) \rightarrow (\varvec{?}^6, \bot )\);
-
\(v_2 = (\varvec{?}^6, \bot ) \rightarrow (\varvec{?}^6, \bot ) \rightarrow (\varvec{?}^6, \bot )\);
-
\(v_3 = (\varvec{?}^6, \bot ) \rightarrow (\varvec{?}^6, \bot ) \rightarrow (\varvec{?}^6, \bot ) \rightarrow (\varvec{?}^6, \bot )\);
-
\(v_4 = (\varvec{?}^6, \bot ) \rightarrow (\varvec{?}^6, \bot ) \rightarrow (\varvec{?}^6, \bot ) \rightarrow (\varvec{?}^6, \bot ) \rightarrow (\heartsuit \clubsuit \varvec{?}^4, \bot )\).
We describe an execution of this protocol starting with an initial sequence \(s_0 = (\mathsf {com}(x_1), \mathsf {com}(x_2), \mathsf {com}(1))\) as follows:
where the commitment \(\mathsf {com}(b)\) (\(b \in \{0,1\}\)) be two face-down cards whose front sides are
if \(b=0\) and
otherwise. The protocol proceeds as follows:
-
1.
\((\mathsf {perm}, (2\;4\;3))\): Rearrange the order of the sequence as follows:
-
2.
\((\mathsf {shuffle}, \varPi , D)\): Apply the shuffle:
This shuffle is called a random bisection cut.
-
3.
\((\mathsf {perm}, (2\;4\;3)^{-1})\): Rearrange the order of the sequence as follows:
-
4.
\((\mathsf {turn}, \{1,2\})\): Turn the leftmost commitment as follows:
If it is the former case, i.e., the opened symbols are
, the protocol terminates. Otherwise, it proceeds to the next Step.
-
5.
\((\mathsf {perm}, (1\;2) (3\;5) (4\;6)\})\): Rearrange the order of the sequence as follows:
After Steps 4 and 5, the protocol terminates. Then, the finial sequence is given as follows:
Since it contains a commitment to \(x_1 \wedge x_2\), it is said to be an AND protocol. \(\blacksquare \)
Functionality
In order to define the correctness and the security of protocols, we introduce a notion of functionality. Informally speaking, a functionality is a pair of sequences parametrized by input variables \(\mathbf {x} \in X^n\). For example, the following is the functionality \({\mathcal {F}}_\mathrm{AND}\) of Mizuki-Sone’s AND protocol (See Example 5).
It is also described as follows:
$$\begin{aligned} {\mathcal {F}}_\mathrm{AND}: (\mathsf {com}(x_1), \mathsf {com}(x_2), \mathsf {com}(1)) \Rightarrow (\clubsuit \heartsuit , \mathsf {com}(x_1 \wedge x_2), \mathsf {com}(\overline{x_1} \wedge x_2)). \end{aligned}$$
When some part of input/output sequences in a functionality are not important, \(\bot \) is used. For example, when the AND protocol does not care about the rightmost commitment in the output sequence, it is described as follows:
$$\begin{aligned} {\mathcal {F}}'_\mathrm{AND}: (\mathsf {com}(x_1), \mathsf {com}(x_2), \mathsf {com}(1)) \Rightarrow (\clubsuit \heartsuit , \mathsf {com}(x_1 \wedge x_2), \bot ^2). \end{aligned}$$
Sequence with a dummy symbol Let \(\overline{\mathcal{D}}= ({\mathcal {C}}, {\mathcal {T}}, \varSigma , \mathsf {vis}, {\mathcal {D}})\) be a deck with \({\mathcal {C}}\cap \{\bot \} = \emptyset \), where \(\bot \) is a dummy symbol. Let \(s = (c_1, c_2, \ldots , c_{\ell }) \in \mathsf {Seq}^{\overline{\mathcal{D}}}\) be a sequence. A sequence \(s' = (c'_1, c'_2, \ldots , c'_{\ell }) \in ({\mathcal {C}}\cup \{\bot \})^{\ell }\) is said to be a dummy sequence of s if \(c'_i \in \{c_i, \bot \}\) for all \(i \in [\ell ]\). Thus, there exist \(2^{\ell }\) dummy sequences of any sequence of \(\ell \) cards. The set of dummy sequences of s is denoted by \(\mathsf {Seq}_{\bot }(s)\). The set of dummy sequences of \(\overline{\mathcal{D}}\) is defined by
$$\begin{aligned} \mathsf {Seq}_{\bot }^{\overline{\mathcal{D}}} = \bigcup _{s \in \mathsf {Seq}^{\overline{\mathcal{D}}}} \mathsf {Seq}_{\bot }(s). \end{aligned}$$
We say that \(s \in \mathsf {Seq}^{\overline{\mathcal{D}}}\) is matched with \(s' \in \mathsf {Seq}_{\bot }^{\overline{\mathcal{D}}}\) if \(s' \in \mathsf {Seq}_{\bot }(s)\).
Example 6
For a sequence \(s = (c_1, c_2, c_3)\), \(\mathsf {Seq}_{\bot }(s)\) is given as follows:
$$\begin{aligned} \mathsf {Seq}_{\bot }(s) =\{&(c_1, c_2, c_3), (\bot , c_2, c_3), (c_1, \bot , c_3), (c_1, c_2, \bot ),\\&(\bot , \bot , c_3), (c_1, \bot , \bot ), (\bot , c_2, \bot ), (\bot , \bot , \bot ) \}. \end{aligned}$$
For a sequence \(s' = (c_1, c_2, c'_3)\) with \(c'_3 \ne c_3\), \(s'\) is matched with \((c_1, c_2, \bot )\). \(\blacksquare \)
Variable sequence Let \(\overline{\mathcal{D}}\) be a deck, X be an input domain, and n be the number of inputs. A variable sequence s over \(\mathsf {Seq}^{\overline{\mathcal{D}}}\) is defined by a function \(s: X^n \rightarrow \mathsf {Seq}^{\overline{\mathcal{D}}}\). A variable dummy sequence s over \(\mathsf {Seq}_{\bot }^{\overline{\mathcal{D}}}\) is defined by a function \(s: X^n \rightarrow \mathsf {Seq}_{\bot }^{\overline{\mathcal{D}}}\).
Example 7
An input sequence s(x) of Mizuki-Sone’s AND protocol is a variable sequence \(s: \{0,1\}^2 \rightarrow \mathsf {Seq}^{\overline{\mathcal{D}}}\) defined as follows:
$$\begin{aligned} s(x) = {\left\{ \begin{array}{ll} (\varvec{?}/\clubsuit , \varvec{?}/\heartsuit , \varvec{?}/\clubsuit , \varvec{?}/\heartsuit , \varvec{?}/\clubsuit , \varvec{?}/\heartsuit ) &{} \hbox { if}\ x = (0,0)\\ (\varvec{?}/\clubsuit , \varvec{?}/\heartsuit , \varvec{?}/\heartsuit , \varvec{?}/\clubsuit , \varvec{?}/\clubsuit , \varvec{?}/\heartsuit ) &{} \hbox { if}\ x = (0,1)\\ (\varvec{?}/\heartsuit , \varvec{?}/\clubsuit , \varvec{?}/\clubsuit , \varvec{?}/\heartsuit , \varvec{?}/\clubsuit , \varvec{?}/\heartsuit ) &{} \hbox { if}\ x = (1,0)\\ (\varvec{?}/\heartsuit , \varvec{?}/\clubsuit , \varvec{?}/\heartsuit , \varvec{?}/\clubsuit , \varvec{?}/\clubsuit , \varvec{?}/\heartsuit ) &{} \text {otherwise.} \end{array}\right. } \end{aligned}$$
An output sequence \(s'(x)\) of Mizuki-Sone’s AND protocol is a variable dummy sequence \(s': \{0,1\}^2 \rightarrow \mathsf {Seq}_{\bot }^{\overline{\mathcal{D}}}\) defined as follows:
$$\begin{aligned} s'(x) = {\left\{ \begin{array}{ll} (\clubsuit /\varvec{?}, \heartsuit /\varvec{?}, \varvec{?}/\heartsuit , \varvec{?}/\clubsuit , \bot ^2) &{} \hbox { if}\ x = (1,1)\\ (\clubsuit /\varvec{?}, \heartsuit /\varvec{?}, \varvec{?}/\clubsuit , \varvec{?}/\heartsuit , \bot ^2) &{} \text {otherwise.} \end{array}\right. } \end{aligned}$$
\(\blacksquare \)
Functionality A functionality is defined as follows:
Definition 5
(Functionality) Let \(\overline{\mathcal{D}}\) be a deck, X be an input domain, and n be the number of inputs. A functionality \({\mathcal {F}}\) is defined by a pair:
$$\begin{aligned} {\mathcal {F}}= (s_{\mathsf {in}}, s_{\mathsf {out}}), \end{aligned}$$
where \(s_{\mathsf {in}}: X^n \rightarrow \mathsf {Seq}^{\overline{\mathcal{D}}}\) is a variable sequence over \(\mathsf {Seq}^{\overline{\mathcal{D}}}\) and \(s_{\mathsf {out}}: X^n \rightarrow \mathsf {Seq}_{\bot }^{\overline{\mathcal{D}}}\) is a variable dummy sequence over \(\mathsf {Seq}_{\bot }^{\overline{\mathcal{D}}}\). \(\blacksquare \)
Correctness
Correctness The correctness of protocols is defined as follows:
Definition 6
(Correctness) Let \({\mathcal {P}}= (n, X, \overline{\mathcal{D}}, {\mathcal {O}}, A)\) be a protocol. Let \({\mathcal {F}}= (s_{\mathsf {in}}, s_{\mathsf {out}})\) be a functionality. We say that \({\mathcal {P}}\) correctly realizes \({\mathcal {F}}\) if for any input \(\mathbf {x} \in X^n\), any execution of \({\mathcal {P}}\) starting with \(s_{\mathsf {in}}(\mathbf {x})\) terminates with a sequence s that is matched with \(s_{\mathsf {out}}(\mathbf {x})\). \(\blacksquare \)
The correctness of protocols in a committed format is defined as follows:
Definition 7
(Correctness in a committed format) Let \(\overline{\mathcal{D}}= ({\mathcal {C}}, {\mathcal {T}}, \varSigma , \mathsf {vis}, {\mathcal {D}})\) and \(\overline{\mathcal{D}}' = ({\mathcal {C}}, {\mathcal {T}}, \varSigma , \mathsf {vis}, {\mathcal {D}}')\) be decks such that \({\mathcal {D}}\) contains n copies of \({\mathcal {D}}'\) as multiset. (\({\mathcal {C}}, {\mathcal {T}}, \varSigma \), and \(\mathsf {vis}\) are common.) Let \({\mathcal {P}}= (n, X, \overline{\mathcal{D}}, {\mathcal {O}}, A)\) be a protocol. Let \({\mathcal {F}}= (s_{\mathsf {in}}, s_{\mathsf {out}})\) be a functionality. Let \(f: X^n \rightarrow X\) be a function. Let \(\mathsf {com}: X \rightarrow \mathsf {Seq}^{\overline{\mathcal{D}}'}\) be a function that takes an input and returns a sequence. We say that \({\mathcal {P}}\) correctly computes f if it satisfies the following:
-
\({\mathcal {P}}\) correctly realizes \({\mathcal {F}}\);
-
\(s_{\mathsf {in}} = (\mathsf {com}(x_1), \mathsf {com}(x_2), \ldots , \mathsf {com}(x_n), s)\) where s is a (possibly empty) fixed sequence;
-
\(s_{\mathsf {out}}\) contains \(\mathsf {com}(f(x_1, x_2, \ldots , x_n))\). \(\blacksquare \)
Security
The probability distribution of a view Let \({\mathcal {P}}= (n, X, \overline{\mathcal{D}}, {\mathcal {O}}, A)\) be a protocol. Let \(s_0 \in \mathsf {Seq}^{\overline{\mathcal{D}}}\) be a sequence and let \(x \in X^n\) be an input. The probability distribution of a view of \({\mathcal {P}}\) with input x and starting with sequence \(s_0\) is denoted by \(\mathsf {view}_{{\mathcal {P}}}(s_0)\), where randomness comes from probability operations (e.g., shuffles).
Security The security of protocols is defined as follows:
Definition 8
(Security) Let \({\mathcal {P}}= (n, X, \overline{\mathcal{D}}, {\mathcal {O}}, A)\) be a protocol. Let \({\mathcal {F}}= (s_{\mathsf {in}}, s_{\mathsf {out}})\) be a functionality. We say that \({\mathcal {P}}\) securely realizes \({\mathcal {F}}\) if for every \(x, x' \in X^n\), it holds \(\mathsf {view}_{{\mathcal {P}}}(s_{\mathsf {in}}(x)) = \mathsf {view}_{{\mathcal {P}}}(s_{\mathsf {in}}(x'))\). \(\blacksquare \)
Example 8
Let us prove that the protocol given in Example 5 securely realizes the functionality \({\mathcal {F}}_\mathrm{AND} = (s_{\mathsf {in}}, s_{\mathsf {out}})\) defined as follows:
$$\begin{aligned} {\mathcal {F}}_\mathrm{AND}: (\mathsf {com}(x_1), \mathsf {com}(x_2), \mathsf {com}(1)) \Rightarrow (\clubsuit \heartsuit , \mathsf {com}(x_1 \wedge x_2), \mathsf {com}(\overline{x_1} \wedge x_2)). \end{aligned}$$
Let \(x \in \{0,1\}^2\) be any input. The probability distribution of a view of the protocol starting with the sequence \(s_{\mathsf {in}}(x) = (\mathsf {com}(x_1), \mathsf {com}(x_2), \mathsf {com}(1))\) is given as follows:
$$\begin{aligned} \mathsf {view}(s_{\mathsf {in}}(x)) = {\left\{ \begin{array}{ll} v \rightarrow (\clubsuit \heartsuit \varvec{?}^4, \bot ) &{} \hbox { with probability}\ 1/2\\ v \rightarrow (\heartsuit \clubsuit \varvec{?}^4, \bot ) \rightarrow (\clubsuit \heartsuit \varvec{?}^4, \bot ) &{} \hbox { with probability}\ 1/2 \end{array}\right. } \end{aligned}$$
where \(v = (\varvec{?}^6, \bot ) \rightarrow (\varvec{?}^6, \bot ) \rightarrow (\varvec{?}^6, \bot ) \rightarrow (\varvec{?}^6, \bot )\). Due to the random bisection cut, the above probability distribution \(\mathsf {view}(s_{\mathsf {in}}(x))\) is the same for any \(x \in \{0,1\}^2\). Therefore, it securely realizes the functionality. \(\blacksquare \)
Composition of Protocols
Subroutine operation Let \({\mathcal {P}}= (n, X, \overline{\mathcal{D}}, {\mathcal {O}}, A)\) be a protocol. A subroutine of \({\mathcal {P}}\) is a “magical box” that executes the protocol \({\mathcal {P}}\) in a single step: it takes a sequence \(s_0 \in \mathsf {Seq}^{\overline{\mathcal{D}}}\) as an input and outputs a final sequence of \({\mathcal {P}}\) when the initial sequence is \(s_0\) as follows:
Formally, a subroutine operation for a protocol \({\mathcal {P}}\) is defined as follows:
$$\begin{aligned} (\mathsf {subroutine}, {\mathcal {P}}, T), \end{aligned}$$
where \(T\subset [\ell ]\) is a subset of positions such that |T| is the number of cards of \({\mathcal {P}}\). (We assume that the number of cards of \({\mathcal {P}}\) is equal to or less than \(\ell \).) The set of subroutine operations with \({\mathcal {P}}\) is denoted as follows:
$$\begin{aligned} \mathsf {Subroutine}_{\ell }[{\mathcal {P}}] = \{(\mathsf {subroutine}, {\mathcal {P}}, T) \mid T \subset [\ell ]\}. \end{aligned}$$
For protocols \({\mathcal {P}}_1, {\mathcal {P}}_2, \ldots , {\mathcal {P}}_k\), we define the set of subroutine operations as follows:
$$\begin{aligned} \mathsf {Subroutine}_{\ell }[{\mathcal {P}}_1, {\mathcal {P}}_2, \ldots , {\mathcal {P}}_k] = \mathsf {Subroutine}_{\ell }[{\mathcal {P}}_1] \cup \mathsf {Subroutine}_{\ell }[{\mathcal {P}}_2] \cup \cdots \cup \mathsf {Subroutine}_{\ell }[{\mathcal {P}}_k]. \end{aligned}$$
We define an subroutine-respecting protocol as follows:
Definition 9
(Subroutine-respecting protocol) Let \({\mathcal {F}}_\mathrm{sub} = (s_{\mathsf {in}}, s_{\mathsf {out}})\) be a functionality using \(\ell _\mathrm{sub}\) cards. Let \({\mathcal {P}}_\mathrm{sub} = (n_\mathrm{sub}, X_\mathrm{sub}, \overline{\mathcal{D}}_\mathrm{sub}, {\mathcal {O}}_\mathrm{sub}, A_\mathrm{sub})\) be a protocol using \(\ell _\mathrm{sub}\) cards. Let \({\mathcal {P}}= (n, X, \overline{\mathcal{D}}, {\mathcal {O}}, A)\) be a protocol using \(\ell \) cards (\(\ell \ge \ell _\mathrm{sub}\)). We say that \({\mathcal {P}}\) is subroutine-respecting for \({\mathcal {P}}_\mathrm{sub}\) and \({\mathcal {F}}_\mathrm{sub}\) if it satisfies as follows:
-
\(\mathsf {Subroutine}_{\ell }[{\mathcal {P}}_\mathrm{sub}] \subset {\mathcal {O}}\);
-
For any input \(x \in \{0,1\}^n\), whenever \({\mathcal {P}}\) enters an operation \((\mathsf {subroutine}, {\mathcal {P}}_\mathrm{sub}, T)\), the cards on positions T in the current sequence is identical to \(s_{\mathsf {in}}(x')\) for some input \(x' \in X_\mathrm{sub}\). Here, the input \(x'\) for \({\mathcal {P}}_\mathrm{sub}\) can be varied for each call of the subroutine for \({\mathcal {P}}_\mathrm{sub}\). \(\blacksquare \)
Example 9
Let \({\mathcal {P}}_\mathrm{AND2}\) be a two-bit AND protocol defined as follows:
$$\begin{aligned} {\mathcal {P}}_\mathrm{AND2} = (2, \{0,1\}, (\mathsf {Binary}, \{(\clubsuit /\varvec{?})^3, (\heartsuit /\varvec{?})^3\}), \mathsf {Perm}_6 \cup \mathsf {Turn}_6 \cup \mathsf {Shuf}_6, A), \end{aligned}$$
that correctly and securely realizes a functionality \({\mathcal {F}}_\mathrm{AND2}\) as follows:
This is obtained from Mizuki and Sone’s AND protocol in Example 5 with a small modification. By using the subroutine of \({\mathcal {P}}_\mathrm{AND2}\), we construct an eight-card three-bit AND protocol \({\mathcal {P}}_\mathrm{AND3}\) defined as follows:
$$\begin{aligned} {\mathcal {P}}_\mathrm{AND3} = (3, \{0,1\}, (\mathsf {Binary}, \{(\clubsuit /\varvec{?})^4, (\heartsuit /\varvec{?})^4\}), \mathsf {Subroutine}_{8}[{\mathcal {P}}_\mathrm{AND2}], A'). \end{aligned}$$
that realizes a functionality \({\mathcal {F}}_\mathrm{AND3} = (s_{\mathsf {in}}, s_{\mathsf {out}})\) as follows:
It proceeds as follows:
-
1.
\((\mathsf {subroutine}, {\mathcal {P}}_\mathrm{AND2}, \{1,2,3,4,7,8\})\): Apply the two-bit AND protocol for cards on \(\{1,2,3,4,7,8\}\) as follows:
-
2.
\((\mathsf {subroutine}, {\mathcal {P}}_\mathrm{AND2}, \{3,4,5,6,7,8\})\): Apply the two-bit AND protocol for cards on \(\{3,4,5,6,7,8\}\) as follows:
We can observe that the protocol \({\mathcal {P}}_\mathrm{AND3}\) is subroutine-respecting for \({\mathcal {P}}_\mathrm{AND2}\) and \({\mathcal {F}}_\mathrm{AND2}\): the first condition in Definition 9 is satisfied since the operation set of \({\mathcal {P}}_\mathrm{AND3}\) is \(\mathsf {Subroutine}_{8}[{\mathcal {P}}_\mathrm{AND2}]\); and, the second condition in Definition 9 is satisfied since for each call of the subroutine \({\mathcal {P}}_\mathrm{AND2}\), the cards on positions T in the sequence is identical to \(s_{\mathsf {in}}(x')\) for some \(x' \in \{0,1\}^2\). \(\blacksquare \)
Proposition 1
(Composition theorem) Let \({\mathcal {P}}_i = (n_i, X_i, \overline{\mathcal{D}}_i, {\mathcal {O}}_i, A_i)\) (\(i \in [k]\)) be a protocol that correctly and securely realizes a functionality \({\mathcal {F}}_i\). Let \({\mathcal {P}}= (n, X, \overline{\mathcal{D}}, {\mathcal {O}}\cup \mathsf {Subroutine}_{\ell }[{\mathcal {P}}_1, {\mathcal {P}}_2, \ldots , {\mathcal {P}}_k], A)\) be a protocol that is subroutine-respecting for \({\mathcal {P}}_i\) and \({\mathcal {F}}_i\), and \({\mathcal {O}}\) is upward compatible with \({\mathcal {O}}_i\) for every \(i \in [k]\). If \({\mathcal {P}}\) correctly and securely realizes a functionality \({\mathcal {F}}\), then there exists a protocol \({\mathcal {P}}' = (n, X, \overline{\mathcal{D}}, {\mathcal {O}}, A)\) that correctly and securely realizes \({\mathcal {F}}\). \(\blacksquare \)
Proof
The protocol \({\mathcal {P}}'\) is obtained from the protocol \({\mathcal {P}}\) by replacing all subroutine calls of \({\mathcal {P}}_i\) with the protocols \({\mathcal {P}}_i\) for all \(i \in [k]\). We can observe that the final sequence of \({\mathcal {P}}\) and that of \({\mathcal {P}}'\) are the same since \({\mathcal {P}}\) is subroutine-respecting. Thus, \({\mathcal {P}}'\) correctly realizes \({\mathcal {F}}\). We can also observe that a view of \({\mathcal {P}}'\) is obtained from a view of \({\mathcal {P}}\) by replacing all subroutine calls of \({\mathcal {P}}_i\) with a view of \({\mathcal {P}}_i\) for all \(i \in [k]\). Since \({\mathcal {P}}\) and \({\mathcal {P}}_i\) securely realize \({\mathcal {F}}\) and \({\mathcal {F}}_i\), respectively, for all \(i \in [k]\). Thus, \({\mathcal {P}}'\) also securely realizes \({\mathcal {F}}\). \(\blacksquare \)