0

I look for an elegant approach/ideas (not necessarily code) to draw the following figure in beamer as an animation; which is flexible enough for further changes and similar MSCs in the future.

Thanks in advance. enter image description here

Ref:https://www.researchgate.net/publication/342833256_Towards_Formalization_of_Enhanced_Privacy_ID_EPID-based_Remote_Attestation_in_Intel_SGX

10
  • 3
    Please, also put the image in the question so we don't have to look for what you want to talk about.
    – AndréC
    Aug 1 '20 at 16:46
  • 2
    Please give the code of your first attempts.
    – AndréC
    Aug 1 '20 at 17:25
  • Hi Andre, I added the figure. Regarding the first attempts, I do not look for code, I look for an elegant approach to make it; which is flexible enough for further changes and similar MSCs in the future. I hope I will then do the coding myself.
    – Curious
    Aug 2 '20 at 11:45
  • 1
    On this site, the practice is to ask only one question at the same time and not five as you do. Indeed, this allows the indexing by the search engines of a specific problem and therefore makes it possible to reuse their answers. Therefore, you should keep only one question. When it has one or more answers, you will have to choose the answer that suits you. That being done, you can ask a second question, etc.
    – AndréC
    Aug 2 '20 at 11:52
  • 1
    Look here : lsc – Typesetting Live Sequence Charts
    – AndréC
    Aug 2 '20 at 14:13
0

I will fine tune it today

enter image description here

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fit,angles,calc,intersections,quotes,positioning, shapes.misc, arrows}

\begin{document}\hspace{-4cm}
\begin{tikzpicture}[
every label/.style={text=red},
point/.style={circle,
                inner sep=0pt,
                minimum size=2pt,
                fill=red},
node distance=5mm,
terminal/.style={
    % The shape:
    rectangle,
    minimum height=8mm,
    minimum width=30mm,
    inner sep=4pt,
    rounded corners=2mm,
    % The rest
    very thick,
    draw=black!50,
    top color=white,
    bottom color=black!20,
    text width=25mm,
    align=center,
    font=\ttfamily, 
    font=\scriptsize}
]
\matrix[
row sep=7mm,
column sep=10mm]{
    %first row
    \node (digit1) [terminal] {Intel Quoting Enclave};&
    \node (digit2) [terminal] {SGX Application Enclave};&
    \node (digit3) [terminal] {SGX Application};&
    \node (digit4) [terminal] {Remote Challenger};&
    \node (digit5) [terminal] {Intel Attestation Service(IAS)};\\
    %second row
    &&&&\\
    %third row
    \node[point] (p11) {};&\node[point] (p21) {};&\node[point] (p31) {};&\node[point] 
    (p41) {};&\node[point] (p51) {};\\
    %fourth row
\node[point] (p12) {};&\node[point] (p22) {};&\node[point] (p32) {};&\node[point] 
 (p42) {};&\node[point] (p52) {};\\
};
\node [draw=red,
        dash pattern={on 7pt off 2pt on 1pt off 3pt},
        name=temp1,
        fit={(digit1) (digit2) (digit3)},
        rounded corners=1mm,
        label=90:{\scriptsize User Platform/ Local Attestation},
        ] {};
\coordinate  (temp2) at ($(digit1)+(0,-16pt)$);
\coordinate  (temp3) at ($(digit1)+(0,-16cm)$);
\draw   [draw=blue,
        dash pattern={on 7pt off 2pt on 1pt off 3pt},
        ]
        (temp2)--(temp3);

\coordinate  (temp4) at ($(digit2)+(0,-16pt)$);
\coordinate  (temp5) at ($(digit2)+(0,-16cm)$);
\draw   [draw=blue,
        dash pattern={on 7pt off 2pt on 1pt off 3pt},
        ]
        (temp4)--(temp5);       

\coordinate  (temp6) at ($(digit3)+(0,-16pt)$);
\coordinate  (temp7) at ($(digit3)+(0,-16cm)$);
\draw   [draw=blue,
dash pattern={on 7pt off 2pt on 1pt off 3pt},
]
(temp6)--(temp7);       

\coordinate  (temp8) at ($(digit4)+(0,-12pt)$);
\coordinate  (temp9) at ($(digit4)+(0,-16cm)$);
\draw   [draw=blue,
dash pattern={on 7pt off 2pt on 1pt off 3pt},
]
(temp8)--(temp9);       

\coordinate  (temp10) at ($(digit5)+(0,-12pt)$);
\coordinate  (temp11) at ($(digit5)+(0,-16cm)$);
\draw   [draw=blue,
dash pattern={on 7pt off 2pt on 1pt off 3pt},
]
(temp10)--(temp11);     

\draw[->,
        blue, 
        thick, 
        >=stealth
        ] 
    (p41)--node[above, 
                yshift=-4pt,
                label=left:\textcolor{red}{\scriptsize 1},
                ] 
                ()
                {\scriptsize 1 challenge (inc. nonce)} 
    (p31);

\draw[->,
        blue, 
        thick, 
        >=stealth] 
    (p32)--node[above,
                yshift=-4pt,
                pos=0.5
                ] 
                (){\scriptsize 2 MRENCLAVE(QE)}  
            node[below, 
                yshift=2pt,
                pos=0.5
                ] 
                () {\scriptsize  challenge (inc. nonce)}  
     (p22);


\end{tikzpicture}
\end{document}

EDIT 1

enter image description here

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fit,angles,calc,intersections,quotes,positioning, 
shapes.misc, arrows}

\begin{document}\hspace{-5cm}
\begin{tikzpicture}[
every label/.style={text=blue},
point/.style={circle,
                inner sep=0pt,
                minimum size=2pt,
                fill=red},
dot/.style={circle,
                inner sep=3pt,
                minimum size=5pt,
                fill=blue},
node distance=5mm,
terminal/.style={
    % The shape:
    rectangle,
    minimum height=8mm,
    minimum width=30mm,
    inner sep=4pt,
    rounded corners=2mm,
    % The rest
    very thick,
    draw=black!50,
    top color=white,
    bottom color=black!20,
    text width=25mm,
    align=center,
    font=\ttfamily, 
    font=\scriptsize}
]
\matrix[
row sep=7mm,
column sep=10mm]{
    %first row
    \node (digit1) [terminal] {Intel Quoting Enclave};&
    \node (digit2) [terminal] {SGX Application Enclave};&
    \node (digit3) [terminal] {SGX Application};&
    \node (digit4) [terminal] {Remote Challenger};&
    \node (digit5) [terminal] {Intel Attestation Service(IAS)};\\
    %second row
    &&&&\\
    %third row
    \node[point] (p11) {};&\node[point] (p21) {};&\node[point] (p31) {};&\node[point] (p41) {};&\node[point] (p51) {};\\
    %fourth row
\node[point] (p12) {};&\node[point] (p22) {};&\node[point] (p32) {};&\node[point] (p42) {};&\node[point] (p52) {};\\
%fifth row
&&&&\\
%sixth row
&&&&\\
%seventh row
&\node[dot, label={[align=left]right:\scriptsize Create Report \\\scriptsize containing MAC}] (dot1) {};&&&\\
%eigth row
\node[point] (p13) {};&\node[point] (p23) {};&\node[point] (p33) {};&\node[point] (p43) {};&\node[point] (p53) {};\\
%ninth row
\node[point] (p14) {};&\node[point] (p24) {};&\node[point] (p34) {};&\node[point] (p44) {};&\node[point] (p54) {};\\
%tenth row
\node[dot, label={[align=left]right:\scriptsize Verify Report}] (dot2) {};&&&&\\
%eleventh row
\node[dot, label={[align=left]right:\scriptsize Sign with EPID \\ \scriptsize Private Key}] (dot3) {};&&&&\\
%twelthth row
\node[point] (p15) {};&\node[point] (p25) {};&\node[point] (p35) {};&\node[point] (p45) {};&\node[point] (p55) {};\\
%thirteenth row
\node[point] (p16) {};&\node[point] (p26) {};&\node[point] (p36) {};&\node[point] (p46) {};&\node[point] (p56) {};\\
%fourteenth row
&&&&\\
%fifteenth row
\node[point] (p17) {};&\node[point] (p27) {};&\node[point] (p37) {};&\node[point] (p47) {};&\node[point] (p57) {};\\
};
\node [draw=red,
        dash pattern={on 7pt off 2pt on 1pt off 3pt},
        name=temp1,
        fit={(digit1) (digit2) (digit3)},
        rounded corners=1mm,
        label=90:{\scriptsize User Platform/ Local Attestation},
        ] {};
\coordinate  (temp2) at ($(digit1)+(0,-16pt)$);
\coordinate  (temp3) at ($(digit1)+(0,-16cm)$);
\draw   [draw=blue,
        dash pattern={on 7pt off 2pt on 1pt off 3pt},
        ]
        (temp2)--(temp3);

\coordinate  (temp4) at ($(digit2)+(0,-16pt)$);
\coordinate  (temp5) at ($(digit2)+(0,-16cm)$);
\draw   [draw=blue,
        dash pattern={on 7pt off 2pt on 1pt off 3pt},
        ]
        (temp4)--(temp5);       

\coordinate  (temp6) at ($(digit3)+(0,-16pt)$);
\coordinate  (temp7) at ($(digit3)+(0,-16cm)$);
\draw   [draw=blue,
dash pattern={on 7pt off 2pt on 1pt off 3pt},
]
(temp6)--(temp7);       

\coordinate  (temp8) at ($(digit4)+(0,-12pt)$);
\coordinate  (temp9) at ($(digit4)+(0,-16cm)$);
\draw   [draw=blue,
dash pattern={on 7pt off 2pt on 1pt off 3pt},
]
(temp8)--(temp9);       

\coordinate  (temp10) at ($(digit5)+(0,-12pt)$);
\coordinate  (temp11) at ($(digit5)+(0,-16cm)$);
\draw   [draw=blue,
dash pattern={on 7pt off 2pt on 1pt off 3pt},
]
(temp10)--(temp11);     

\draw[->,
        blue, 
        thick, 
        >=stealth
        ] 
    (p41)--node[above, 
                yshift=-4pt,
%               label=left:\textcolor{red}{\scriptsize 1},
                ] 
                ()
                {\scriptsize 1 challenge (inc. nonce)} 
    (p31);

\draw[->,
        blue, 
        thick, 
        >=stealth] 
    (p32)--node[above,
                yshift=-4pt,
                pos=0.5
                ] 
                (){\scriptsize 2 MRENCLAVE(QE)}  
            node[below, 
                yshift=2pt,
                pos=0.5
                ] 
                () {\scriptsize  challenge (inc. nonce)}  
     (p22);

\draw[->,
        blue, 
        thick, 
        >=stealth] 
    (p23)--node[above,
                yshift=-4pt,
                pos=0.5
                ] 
        (){\scriptsize 3 Report}  
%   node[below, 
%       yshift=2pt,
%       pos=0.5
%       ] 
%       () {\scriptsize  challenge (inc. nonce)}  
    (p33);


\draw[->,
        blue, 
        thick, 
        >=stealth] 
    (p34)--node[above,fill=white,
                yshift=0pt,
                pos=0.5
                ] 
                (){\scriptsize 4 Report}  
    (p14);
    
\draw[->,
        blue, 
        thick, 
        >=stealth] 
    (p15)--node[above,fill=white,
                yshift=0pt,
                pos=0.5
                ] 
                (){\scriptsize 5 Quote, CMAC}  
    (p35);

\draw[->,
        blue, 
        thick, 
        >=stealth] 
    (p36)--node[above,fill=white,
                yshift=0pt,
                pos=0.5
                ] 
                (){\scriptsize 6 Quote, CMAC}  
    (p46);

\draw[<->,
        blue, 
        thick, 
        >=stealth] 
    (p47)--node[above,fill=white,align=left,
                yshift=0pt,
                pos=0.5
                ] 
                (){\scriptsize 7 Verify sign over Quote\\ \scriptsize Verify enclave status}  
    (p57);
    
\end{tikzpicture}
\end{document}

Final EDIT

enter image description here

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fit,angles,calc,intersections,quotes,positioning, shapes.misc, arrows}
\newcommand*\crc[1]{    
\scriptsize \raisebox{2pt}{\textcircled{\raisebox{-.9pt} {#1}}}}

\begin{document}\hspace{-5cm}
\begin{tikzpicture}[
every label/.style={text=black},
every node/.style={font=\scriptsize},
arw/.style={->,black,thick,>=stealth},
abov/.style={above,yshift=-4pt,pos=0.5},
point/.style={circle,inner sep=0pt,minimum size=2pt,fill=black},
dot/.style={circle,inner sep=3pt,minimum size=1pt,fill=black},
node distance=5mm,
terminal/.style={rectangle,minimum height=8mm,minimum width=30mm,
    inner sep=4pt,rounded corners=2mm,very thick,
    draw=black!90,top color=white,bottom color=black!20,
    text width=25mm,align=center,
    font=\ttfamily, font=\scriptsize},
]
\matrix[
row sep=7mm,
column sep=10mm]{
    %first row
    \node (digit1) [terminal] {Intel Quoting Enclave};&
    \node (digit2) [terminal] {SGX Application Enclave};&
    \node (digit3) [terminal] {SGX Application};&
    \node (digit4) [terminal] {Remote Challenger};&
    \node (digit5) [terminal] {Intel Attestation Service(IAS)};\\
    %second row
    &&&&\\
    %third row
    \node[point] (p11) {};&\node[point] (p21) {};&\node[point] (p31) {};&\node[point] (p41) {};&\node[point] (p51) {};\\
    %fourth row
\node[point] (p12) {};&\node[point] (p22) {};&\node[point] (p32) {};&\node[point] (p42) {};&\node[point] (p52) {};\\
%fifth row
&&&&\\
%sixth row
&&&&\\
%seventh row
&\node[dot, label={[align=left]right:Create Report \\containing MAC}] (dot1) {};&&&\\
%eigth row
\node[point] (p13) {};&\node[point] (p23) {};&\node[point] (p33) {};&\node[point] (p43) {};&\node[point] (p53) {};\\
%ninth row
\node[point] (p14) {};&\node[point] (p24) {};&\node[point] (p34) {};&\node[point] (p44) {};&\node[point] (p54) {};\\
%tenth row
\node[dot, label={[align=left]right: Verify Report}] (dot2) {};&&&&\\
%eleventh row
\node[dot, label={[align=left]right: Sign with EPID \\  Private Key}] (dot3) {};&&&&\\
%twelthth row
\node[point] (p15) {};&\node[point] (p25) {};&\node[point] (p35) {};&\node[point] (p45) {};&\node[point] (p55) {};\\
%thirteenth row
\node[point] (p16) {};&\node[point] (p26) {};&\node[point] (p36) {};&\node[point] (p46) {};&\node[point] (p56) {};\\
%fourteenth row
&&&&\\
%fifteenth row
\node[point] (p17) {};&\node[point] (p27) {};&\node[point] (p37) {};&\node[point] (p47) {};&\node[point] (p57) {};\\
};
\node [draw=black,dash pattern={on 7pt off 2pt on 1pt off 3pt},thick,
        name=temp1,fit={(digit1) (digit2) (digit3)},
        rounded corners=1mm,label=90:{ User Platform/ Local Attestation},
        ] {};

\foreach \x[count=\xi] in {2,4,6}{
    \foreach \y in {3,5,7}{
    \coordinate  (temp\x) at ($(digit\xi)+(0,-16pt)$);
    \coordinate  (temp\y) at ($(digit\xi)+(0,-16cm)$);
    \draw   [draw=black,thick,
    dash pattern={on 7pt off 2pt on 1pt off 3pt},
    ]
    (temp\x)--(temp\y);     
}}
\foreach \x[count=\xi from 4] in {8,10}{
    \foreach \y in {9,11}{
        \coordinate  (temp\x) at ($(digit\xi)+(0,-12pt)$);
        \coordinate  (temp\y) at ($(digit\xi)+(0,-16cm)$);
        \draw   [draw=black,thick,
        dash pattern={on 7pt off 2pt on 1pt off 3pt},
        ]
        (temp\x)--(temp\y);     
}}

\draw[arw] (p41)--node[abov,yshift=-1pt,]()
                {\crc{1}\ challenge (inc. nonce)}(p31);

\draw[arw] (p32)--node[abov,] 
                (){\crc{2}\  MRENCLAVE(QE)}  
            node[below,yshift=2pt,pos=0.5] 
                () {  challenge (inc. nonce)} (p22);

\draw[arw] (p23)--node[abov,] 
        (){\crc{3}\ Report} (p33);

\draw[arw](p34)--node[abov,fill=white,yshift=4pt,] 
                (){\crc{4}\ Report}(p14);
    
\draw[arw] (p15)--node[abov,fill=white,yshift=4pt,] 
                (){\crc{5}\ Quote, CMAC}(p35);

\draw[arw] (p36)--node[abov,fill=white,yshift=4pt,] 
                (){\crc{6}\ Quote, CMAC}(p46);

\draw[arw,<->] (p47)--node[abov,fill=white,align=left,yshift=4pt,] 
    (){\crc{7}\ Verify sign over Quote\\  Verify enclave status}(p57);
    
\end{tikzpicture}
\end{document}
2
  • i think by mistake someone pressed the -1 instead of the +1 ha ha
    – js bibra
    Aug 3 '20 at 23:38
  • Although a lot of effort in the above solution, it is hard to reuse/adapt. Maybe some suggestions for more elegant codes/packages?
    – Curious
    Dec 26 '20 at 18:14

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.