-
Notifications
You must be signed in to change notification settings - Fork 1
/
tikzlibrarycrypto.symbols.code.tex
165 lines (148 loc) · 2.84 KB
/
tikzlibrarycrypto.symbols.code.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
\usetikzlibrary{arrows} %% Include regular arrows
\usepgflibrary{arrows.new} %% Include custom arrows
\usetikzlibrary{shadows.blur} %% Include the package to add shadows
%%
%% XOR in TIKZ
%%
\tikzset{XOR/.style={thick,
draw,
circle,
append after command={
[shorten >=\pgflinewidth, shorten <=\pgflinewidth,]
(\tikzlastnode.north) edge[thick] (\tikzlastnode.south)
(\tikzlastnode.east) edge[thick] (\tikzlastnode.west)
},
},
}
%%
%% ADD in TIKZ
%%
\tikzset{ADD/.style={thick,
draw,
rectangle,
append after command={
[shorten >=\pgflinewidth, shorten <=\pgflinewidth,]
(\tikzlastnode.north) edge[thick] (\tikzlastnode.south)
(\tikzlastnode.east) edge[thick] (\tikzlastnode.west)
},
},
}
%%
%% MOD ADD in TIKZ
%%
\tikzset{MODADD/.style={thick,
draw,
rectangle,
append after command={
[shorten >=\pgflinewidth, shorten <=\pgflinewidth,]
(\tikzlastnode.north) edge[thick] (\tikzlastnode.south)
(\tikzlastnode.east) edge[thick] (\tikzlastnode.west)
},
},
}
%%% Shadows
\tikzset{
%% XOR node
shadows/.is choice,
shadows/yes/.style={
XOR/.append style={fill=white,blur shadow={shadow blur steps=5}},
ADD/.append style={blur shadow={shadow blur steps=5}},
MODADD/.append style={fill=white,blur shadow={shadow blur steps=5}}
},
shadows/no/.style={
},
%% Default: no shadows
shadows = no,
}
%%%%%%%%%%%%%%%%%%%%%% AUTHENTICATED ENCRYPTION %%%%%%%%%%%%%%%%%%%%
%%
%% AE: Message block
%%
\tikzset{AE_msg/.style={
rectangle,
thick,
draw,
fill=blue!20,
text width=1cm,
minimum height=0.5cm,
text centered,
anchor=north,
}
}
%%
%% AE: Ciphertext block
%%
\tikzset{AE_ctx/.style={
rectangle,
thick,
draw,
fill=green!20,
text width=1cm,
minimum height=0.5cm,
text centered,
anchor=north,
}
}
%%
%% AE: Tag block
%%
\tikzset{AE_tag/.style={
rectangle,
thick,
draw,
fill=red!20,
text width=1cm,
minimum height=0.5cm,
text centered,
anchor=north,
}
}
%%
%% AE: Block cipher call
%%
\tikzset{AE_E/.style={
rectangle,
thick,
draw,
fill=yellow!20,
text width=1cm,
minimum height=1cm,
text centered,
anchor=north,
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%% Custom lines or arrows %%%%%%%%%%%%%%%%%%%%%%%%%%
\tikzset{edge/.style={
-latex new,
arrow head=8pt,
thick
},
}
\tikzset{line/.style={
thick,
draw,
-latex',
shorten <=1bp,
shorten >=1bp,
}
}
\tikzset{doublearrow/.style={
thick,
draw,
latex-latex,
shorten <=1bp,
shorten >=1bp
}
}
\tikzset{edgee/.style={
latex new-latex new,
arrow head=8pt,
thick,
}
}
\tikzset{Redge/.style={
latex new-,
arrow head=8pt,
thick,
}
}