\begin{figure}[h!]
  \centering
  %\footnotesize % Apply footnotesize to all text
  \setmsckeyword{}
  \drawframe{no}    % uncomment to not draw a frame
  \begin{msc}[
    /msc/title top distance=0cm,
    /msc/first level height=.1cm,
    /msc/last level height=0.7cm,  % Slightly reduced
    /msc/head height=0cm,
    /msc/instance width=0cm,
    /msc/head top distance=0.5cm,
    /msc/foot distance=-0.0cm,
    /msc/instance width=0cm,
  /msc/every label/.append style = {    % extra style for all labels
    /tikz/fill       = white,           % paint a white rectangle
    /tikz/draw       = none,            % no border
    /tikz/inner sep  = 1pt              % a little padding
  },
    /msc/condition height=0.1cm,  % Reduced condition height
    ]{}
    %%%%%%%%%%%%%%%%%% CONFIG %%%%%%%%%%%%%%%%%%%%%%%%%
    \setlength{\instwidth}{0\mscunit} % to remove default box below agents 
    \setlength{\instdist}{2.21cm}  % default value between agents

    %%%%%%%%%%%%%%%%%% AGENTS %%%%%%%%%%%%%%%%%%%%%%%%%
    \declinst{A}{              % Alice
      \begin{tabular}[c]{c}
        Alice (Initiator) \\
      \end{tabular}
    }{}
    \declinst{Server}{              % Alice
      \begin{tabular}[c]{c}
        Server \\
      \end{tabular}
    }{}
    \declinst{B}{              % Bob
      \begin{tabular}[c]{c}
        Bob (Responder)
      \end{tabular}
    }{}



    \nextlevel[0.25]


\action*{
  \footnotesize
  \begin{tabular}{@{}l@{}}
    \textsf{(pk\textsubscript{A}, sk\textsubscript{A}) = DH\_Gen()} \\
    \textsf{(spk\textsubscript{A}, ssk\textsubscript{A}) = SignGen()} \\
    \textsf{sig\_pk\textsubscript{A} = Sign(spk\textsubscript{A}, pk\textsubscript{A})}
  \end{tabular}
}{A}

\action*{
  \footnotesize
  \begin{tabular}{@{}l@{}}
    \textsf{(pk\textsubscript{B}, sk\textsubscript{B}) = DH\_Gen()} \\
    \textsf{(spk\textsubscript{B}, ssk\textsubscript{B}) = SignGen()} \\
    \textsf{sig\_pk\textsubscript{B} = Sign(spk\textsubscript{B}, pk\textsubscript{B})}
  \end{tabular}
}{B}

    \nextlevel[3]

  \condition{{{\footnotesize out-of-band verification of \textsf{spk\textsubscript{A}, spk\textsubscript{B}}}}}{B,A,Server}

    %\nextlevel[2.5]
    %\mess{\footnotesize\textsf{spk\textsubscript{A}, sig\_pk\textsubscript{A}, pk\textsubscript{A}}}{A}{B}
    \nextlevel[2.5]
    \mess{\footnotesize\textsf{spk\textsubscript{B}, sig\_pk\textsubscript{B}, pk\textsubscript{B}}}{B}{Server}

  \nextlevel[1.25]

    \mess{\footnotesize Request pre-keys}{A}{Server}
  \nextlevel[1.25]


    \mess{\footnotesize\textsf{spk\textsubscript{B}, sig\_pk\textsubscript{B}, pk\textsubscript{B}}}{Server}{A}

  \nextlevel[0.75]

\action*{
  \footnotesize
  \begin{tabular}{@{}l@{}}
    \textsf{if CheckSign(spk\textsubscript{B}, pk\textsubscript{B}, sig\_pk\textsubscript{B})} \\
    \textsf{key = DH(sk\textsubscript{A}, pk\textsubscript{B})}
  \end{tabular}
}{A}

  \nextlevel[3.15]

  % \mess{\footnotesize\textsf{spk\textsubscript{A}, sig\_pk\textsubscript{A}, pk\textsubscript{A}}}{A}{B}
  % \mess{\footnotesize\raisebox{-0.5ex}\colorbox{white}{\textsf{spk\textsubscript{A}, sig\_pk\textsubscript{A}, pk\textsubscript{A}}}}{A}{B}

\mess{%
  \smash{\raisebox{-0.05ex}{\makebox[0pt]{%
    \colorbox{white}{\footnotesize\textsf{spk\textsubscript{A}, sig\_pk\textsubscript{A}, pk\textsubscript{A}}}%
  }}}
}{A}{B}

  \nextlevel[0.5]

\action*{
  \footnotesize
  \begin{tabular}{@{}l@{}}
    \textsf{if CheckSign(spk\textsubscript{A}, pk\textsubscript{A}, sig\_pk\textsubscript{A})} \\
    \textsf{key = DH(sk\textsubscript{B}, pk\textsubscript{A})}
  \end{tabular}
}{B}

  \nextlevel[1]

   \end{msc}
   \caption{An example workflow of asynchronous authenticated key exchange. Bob, the responder, uploads his pre-key material ({\footnotesize\textsf{spk\textsubscript{B}, sig\_pk\textsubscript{B}, pk\textsubscript{B}}}) to the server. Alice, the initiator, fetches Bob's key material from the central server at her leasure, and initiates the authenticated key exchange and \textsf{DH} key agreement}

\end{figure}

