# protocol flow tikz

can somebody please help with tikz suggestion to create the attached protocol diagram? Many thanks

• Hmm, do you really need TikZ for this? – wilx Oct 11 '16 at 5:34
• not really, can you point me to something else? – rimrim Oct 11 '16 at 5:37

This does it for me:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
$\begin{array}{c c c} \text{\textsf{Prover}} & & \text{\textsf{Verifier}} \\ (x = \log_g h) & & \\ u\in_R \mathbb{Z}_n & & \\ a \gets g^u & \xrightarrow{\hspace{1em}a\hspace{1em}} & \\ & & c\in_R \{0,1\} \\ & \xleftarrow{\hspace{1em}c\hspace{1em}} & \\ r\gets_n\begin{cases} \begin{array}{l l} u, & \text{if}\ c=0 \\ u + x, & \text{if}\ c=1 \end{array} \end{cases} & \xleftarrow{\hspace{1em}r\hspace{1em}} & g^r \stackrel{?}{=} \begin{cases} \begin{array}{l l} a, & \text{if}\ c=0 \\ ah, & \text{if}\ c=1 \end{array} \end{cases} \end{array}$
\end{document}


Preview:

UPDATE: I have missed braces around {0,1}. I have fixed the LaTeX above and not updated the preview.