-1

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

enter image description here

  • 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
3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.