Removed intial indentation in algorithms

This commit is contained in:
2023-03-28 14:57:12 +02:00
parent 90346155a5
commit fe4c190cbc
2 changed files with 35 additions and 34 deletions

View File

@@ -16,13 +16,14 @@ The \sdlog game is a variant of the discrete logarithm game which represents the
\begin{figure}
%TODO: include padding
\hrule
\begin{algorithmic}[1]
\Statex \underline{\game \sdlog}
\State \quad $a \randomsample \{ 2^{n-1}, 2^{n-1} + 8, ..., 2^{n} - 8 \}$
\State \quad $\groupelement{A} \assign a \groupelement{B}$
\State \quad $a' \randomassign \adversary{A}(\groupelement{A})$
\State \quad \Return $a \test a'$
\State $a \randomsample \{ 2^{n-1}, 2^{n-1} + 8, ..., 2^{n} - 8 \}$
\State $\groupelement{A} \assign a \groupelement{B}$
\State $a' \randomassign \adversary{A}(\groupelement{A})$
\State \Return $a \test a'$
\end{algorithmic}
\hrule
\caption{\sdlog}
@@ -47,25 +48,25 @@ The adversary has to call the \ioracle oracle with a commitment $\groupelement{R
\large
\begin{algorithmic}[1]
\Statex \underline{\game $G_0$ / \textcolor{blue}{$G_1$} / \textcolor{red}{$G_2$}}
\State \quad $a \randomsample \{2^{n-1}, 2^{n-1} + 8, ..., 2^n - 8\}$
\State \quad $\groupelement{A} \assign a \groupelement{B}$
\State \quad $s^* \randomsample \adversary{A}^{\ioracle(\inp)}(\groupelement{A})$
\State \quad \Return $\exists \groupelement{R}^*, \ch^*: \groupelement{R}^* = 2^c (s^* \groupelement{B} - \ch^* \groupelement{A}) \wedge (\groupelement{R}^*, \ch^*) \in Q$
\State $a \randomsample \{2^{n-1}, 2^{n-1} + 8, ..., 2^n - 8\}$
\State $\groupelement{A} \assign a \groupelement{B}$
\State $s^* \randomsample \adversary{A}^{\ioracle(\inp)}(\groupelement{A})$
\State \Return $\exists \groupelement{R}^*, \ch^*: \groupelement{R}^* = 2^c (s^* \groupelement{B} - \ch^* \groupelement{A}) \wedge (\groupelement{R}^*, \ch^*) \in Q$
\end{algorithmic}
\columnbreak
\begin{algorithmic}[1]
\Statex \underline{\oracle \ioracle($\agmgroupelement{R_i}{r_i} \in \group{G}$)}
\State \quad Let $\groupelement{R}_i = r_1 \groupelement{B} + r_2 \groupelement{A}$
\State \quad $\ch_i \randomsample \{0,1\}^{2b}$
\State Let $\groupelement{R}_i = r_1 \groupelement{B} + r_2 \groupelement{A}$
\State $\ch_i \randomsample \{0,1\}^{2b}$
\BeginBox[draw=blue]
\State \quad \textbf{If} $2^c \ch_i \equiv -r_2 \pmod L$ \textbf{then}
\State \qquad $bad \assign true$
\State \textbf{If} $2^c \ch_i \equiv -r_2 \pmod L$ \textbf{then}
\State \quad $bad \assign true$
\BeginBox[draw=red,dashed]
\State \qquad $abort$
\State \quad $abort$
\EndBox
\EndBox
\State \quad $Q \assign Q \cup \{ (\groupelement{R}_i, \ch_i) \}$
\State \quad \Return $\ch_i$
\State $Q \assign Q \cup \{ (\groupelement{R}_i, \ch_i) \}$
\State \Return $\ch_i$
\end{algorithmic}
\end{multicols}
\hrule
@@ -101,22 +102,22 @@ The adversary has to call the \ioracle oracle with a commitment $\groupelement{R
\large
\begin{algorithmic}[1]
\Statex \underline{\textbf{Adversary} $\adversary{B}(\groupelement{A})$}
\State \quad $s^* \randomassign \adversary{A}^{\ioracle(\inp)}(\groupelement{A})$
\State \quad \textbf{If} $\nexists \agmgroupelement{R^*}{r^*}, \ch^*: \groupelement{R}^* = 2^c (s^* \groupelement{B} - \ch^* \groupelement{A}) \wedge (\agmgroupelement{R^*}{r^*}, \ch^*) \in Q$ \textbf{then}
\State \qquad $abort$
\State \quad Let $R^* = r_1 \groupelement{B} + r_2 \groupelement{A}$
\State \quad \Return $(2^c s^* - r_1)(r_2 + 2^c \ch^*)^{-1}$
\State $s^* \randomassign \adversary{A}^{\ioracle(\inp)}(\groupelement{A})$
\State \textbf{If} $\nexists \agmgroupelement{R^*}{r^*}, \ch^*: \groupelement{R}^* = 2^c (s^* \groupelement{B} - \ch^* \groupelement{A}) \wedge (\agmgroupelement{R^*}{r^*}, \ch^*) \in Q$ \textbf{then}
\State \quad $abort$
\State Let $R^* = r_1 \groupelement{B} + r_2 \groupelement{A}$
\State \Return $(2^c s^* - r_1)(r_2 + 2^c \ch^*)^{-1}$
\end{algorithmic}
\columnbreak
\begin{algorithmic}[1]
\Statex \underline{\oracle \ioracle($\agmgroupelement{R_i}{r_i} \in \group{G}$)}
\State \quad Let $\groupelement{R}_i = r_1 \groupelement{B} + r_2 \groupelement{A}$
\State \quad $\ch_i \randomsample \{0,1\}^{2b}$
\State \quad \textbf{If} $2^c \ch_i \equiv -r_2 \pmod L$ \textbf{then}
\State \qquad $bad \assign true$
\State \qquad $abort$
\State \quad $Q \assign Q \cup \{ (\agmgroupelement{R_i}{r_i}, \ch_i) \}$
\State \quad \Return $\ch_i$
\State Let $\groupelement{R}_i = r_1 \groupelement{B} + r_2 \groupelement{A}$
\State $\ch_i \randomsample \{0,1\}^{2b}$
\State \textbf{If} $2^c \ch_i \equiv -r_2 \pmod L$ \textbf{then}
\State \quad $bad \assign true$
\State \quad $abort$
\State $Q \assign Q \cup \{ (\agmgroupelement{R_i}{r_i}, \ch_i) \}$
\State \Return $\ch_i$
\end{algorithmic}
\end{multicols}
\hrule

View File

@@ -8,17 +8,17 @@ This section shows that \igame implies the UF-NMA security if the EdDSA signatur
\large
\begin{algorithmic}[1]
\Statex \underline{\game \igame}
\State \quad $a \randomsample \{2^{n-1}, 2^{n-1} + 8, ..., 2^n - 8\}$
\State \quad $\groupelement{A} \assign a \groupelement{B}$
\State \quad $s^* \randomsample \adversary{A}^{\ioracle(\inp)}(\groupelement{A})$
\State \quad \Return $\exists \groupelement{R}^*, \ch^*: \groupelement{R}^* = 2^c (s^* \groupelement{B} - \ch^* \groupelement{A}) \wedge (\groupelement{R}^*, \ch^*) \in Q$
\State $a \randomsample \{2^{n-1}, 2^{n-1} + 8, ..., 2^n - 8\}$
\State $\groupelement{A} \assign a \groupelement{B}$
\State $s^* \randomsample \adversary{A}^{\ioracle(\inp)}(\groupelement{A})$
\State \Return $\exists \groupelement{R}^*, \ch^*: \groupelement{R}^* = 2^c (s^* \groupelement{B} - \ch^* \groupelement{A}) \wedge (\groupelement{R}^*, \ch^*) \in Q$
\end{algorithmic}
\columnbreak
\begin{algorithmic}[1]
\Statex \underline{\oracle \ioracle($\groupelement{R_i} \in \group{G}$)}
\State \quad $\ch_i \randomsample \{0,1\}^{2b}$
\State \quad $Q \assign Q \cup \{ (\groupelement{R}_i, \ch_i) \}$
\State \quad \Return $\ch_i$
\State $\ch_i \randomsample \{0,1\}^{2b}$
\State $Q \assign Q \cup \{ (\groupelement{R}_i, \ch_i) \}$
\State \Return $\ch_i$
\end{algorithmic}
\end{multicols}
\hrule