\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}{4cm}  % default value between agents

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

    \action*{
      \footnotesize
      \begin{tabular}{@{}l@{}} 
        \textit{generates} \textsf{symkey\textsubscript{A0}} \\
        \textsf{(pk\textsubscript{A}, sk\textsubscript{A}) = DH\_Gen()} 
      \end{tabular}
    }{A}

    \nextlevel[2.3]

    \condition{{\footnotesize Secure channel establishment via AKE}}{B,A}

    \nextlevel[2.25]

    \mess{
      \footnotesize
      \textsf{
        pk\textsubscript{A}, symkey\textsubscript{A0}
      }
    }{A}{B}

    \nextlevel[0.6]

    \action*{
      \footnotesize
      \begin{tabular}{@{}l@{}}
        \textit{generates} \textsf{m1} \\
        \textsf{symkey\textsubscript{A1}} $\leftarrow$  \textsf{
        Hash(symkey\textsubscript{A0})
        }\\
        \textsf{x1 = Encrypt(symkey\textsubscript{A1}, m1)} \\
        \textsf{x1\_sig = Sign(pk\textsubscript{A}, x1)} 
      \end{tabular}
    }{A}

    \nextlevel[4.4]

    \mess{
      \footnotesize
      (server-side fan-out)
      \textsf{
        x1, x1\_sig
      }
    }{A}{B}

    \nextlevel[0.6]

    \action*{
      \footnotesize
      \begin{tabular}{@{}l@{}}
\textsf{if CheckSign(sk\textsubscript{A}, x1\_sig))} \\
        \textsf{symkey\textsubscript{A1}} $\leftarrow$ \textsf{Hash(symkey\textsubscript{A0})} \\
        \textsf{m1 = Decrypt(symkey\textsubscript{A1}, x1)} 
        % \textit{generates} \textsf{m1} \\
        % \textsf{symkey\textsubscript{A1}} $\leftarrow$  \textsf{
        % Hash(symkey\textsubscript{A0})
        % }\\
        % \textsf{x1 = Encrypt(symkey\textsubscript{A1}, m1)} \\
        % \textsf{x1\_sig = Sign(pk\textsubscript{A}, x1)} 
      \end{tabular}
    }{B}

    % \action*{
      % \footnotesize
      % \begin{tabular}{@{}l@{}}

        % \textsf{if CheckSign(sk\textsubscript{A}, x1\_sig))} \\
        % \textsf{symkey\textsubscript{A1}} $\leftarrow$ \textsf{Hash(symkey\textsubscript{A0})} \\
        % \textsf{m1 = Decrypt(symkey\textsubscript{A1}, x1)} \\
        % % \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}



   \end{msc}

   \caption{An example workflow of session transmission from Alice to Bob. Alice transmits her session information, including her session's symmetric key {\footnotesize\textsf{symkey\textsubscript{A0}}} and public signing key {\footnotesize\textsf{pk\textsubscript{A}}}. Alice generates a new message {\footnotesize\textsf{m1}}, hashes her session's symmetric key and uses it to encrypt {\footnotesize\textsf{m1}}, signs the ciphertext with {\footnotesize\textsf{sk\textsubscript{A}}}, then sends the ciphertext and signature to the server for server-side fan-out. The recipient, Bob, checks the signature, hashes his copy of the symmetric key, and decrypts.
   }

\end{figure}

