-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreport.tex
318 lines (273 loc) · 7.54 KB
/
report.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
\documentclass[12pt, a4paper]{third-rep}
% colours
\usepackage[table]{xcolor}
\definecolor{mydarkblue}{rgb}{0,0.08,0.45}
\definecolor{mintbg}{rgb}{0.95,0.95,0.95}
\definecolor{listingframe}{rgb}{1,0.31,0}
\definecolor{rust}{rgb}{0.871,0.647,0.517}
\definecolor{c}{rgb}{0.33,0.33,0.33}
% tcolorbox my beloved
\usepackage{tcolorbox}
\tcbuselibrary{skins,listings,raster,minted,breakable}
\newtcbinputlisting[auto counter]{\pythoncode}[3][]{
enhanced jigsaw,breakable,
boxrule=0.2mm,top=1mm,bottom=1mm,left=1mm,right=1mm,
before=\par\smallskip,after=\par\smallskip,
listing file={#3},
listing only,
listing engine=minted,
minted language=python,
minted style=colorful,
colback=mintbg,
colframe=listingframe,
fonttitle=\bfseries,
title={Python Listing \thetcbcounter: #2},
#1
}
\newtcbinputlisting[auto counter]{\rustcode}[3][]{
enhanced jigsaw,breakable,
boxrule=0.2mm,top=1mm,bottom=1mm,left=1mm,right=1mm,
before=\par\smallskip,after=\par\smallskip,
listing file={#3},
listing only,
listing engine=minted,
minted language=rust,
minted style=colorful,
colback=mintbg,
colframe=listingframe,
fonttitle=\bfseries,
title={Rust Listing \thetcbcounter: #2},
#1
}
\newtcbinputlisting[auto counter]{\codediff}[3][]{
enhanced jigsaw,breakable,
boxrule=0.2mm,top=1mm,bottom=1mm,left=1mm,right=1mm,
before=\par\smallskip,after=\par\smallskip,
listing file={#3},
listing only,
listing engine=minted,
minted language=diff,
minted style=colorful,
colback=mintbg,
colframe=listingframe,
fonttitle=\bfseries,
title={Diff \thetcbcounter: #2},
#1
}
\newtcbinputlisting[auto counter]{\tomlcode}[3][]{
enhanced jigsaw,breakable,
boxrule=0.2mm,top=1mm,bottom=1mm,left=1mm,right=1mm,
before=\par\smallskip,after=\par\smallskip,
listing file={#3},
listing only,
listing engine=minted,
minted language=toml,
minted style=colorful,
colback=mintbg,
colframe=listingframe,
fonttitle=\bfseries,
title={Toml Listing \thetcbcounter: #2},
#1
}
% graphics
\usepackage{graphicx}
\graphicspath{ {assets/} }
% pifont has dingbats and funny symbols
\usepackage{pifont}
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
% tabularx makes tables better
\usepackage{tabularx}
% minted replaces listings
\usepackage{minted}
\setminted[python]{
breaklines,
breakanywhere,
autogobble,
}
\setminted[rust]{
breaklines,
breakanywhere,
breakautoindent=false,
autogobble,
}
\setminted[diff]{
breaklines,
breakanywhere,
breakautoindent=false,
autogobble,
}
% hyperlink setup
\usepackage{url}
\usepackage{hyperref}
\hypersetup{
pdftitle={},
pdfsubject={},
pdfkeywords={},
pdfborder=0 0 0,
pdfpagemode=UseNone,
colorlinks=true,
linkcolor=mydarkblue,
citecolor=mydarkblue,
filecolor=mydarkblue,
urlcolor=mydarkblue,
}
% provides the ability it strikethrough things
\usepackage{cancel}
\newcommand\hcancel[2][red]{
\setbox0=\hbox{$#2$}\rlap{
\raisebox{.45\ht0}{\textcolor{#1}{\rule{\wd0}{1pt}}}
}#2
}
% used for nesting figures
\usepackage{subcaption}
% Maths/CS symbols
\usepackage{stmaryrd}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
% booktabs makes tables better
\usepackage{booktabs}
\captionsetup[table]{hypcap=false}
% biblatex stuff
\usepackage[style=alphabetic,natbib]{biblatex}
\addbibresource{refs.bib}
% package for defining custom math symbols
\usepackage{stackengine}
\stackMath
\newcommand{\cryptoSample}{\shortleftarrow\kern-1.5ex\text{\scriptsize \$}}
%% Uncomment the following lines if you want to include the date as a
%% header in draft versions. See the documentation for fancyhdr for
%% more ways of modifying headers (texdoc fancyhdr will show you the
%% docs)
% \usepackage{fancyhdr}
% \setlength{\headheight}{14.5pt} % silence warnings
% \pagestyle{fancy}
% \lhead{Draft: \today} % left head
% \chead{} % centre head
% \lfoot{}
% \cfoot{\thepage}
% \rfoot{}
% title stuff
\usepackage{titlesec}
\newcommand{\PreContentTitleFormat}{
\titleformat{\chapter}[display]{\scshape\Large}
{\Large\filleft\MakeUppercase{\chaptertitlename} \Huge\thechapter}
{1ex}
{\titlerule\vspace{1ex}\filright}
[\vspace{1ex}\titlerule]
}
\newcommand{\ContentTitleFormat}{
\titleformat{\chapter}[display]{\scshape\huge}
{\Large\filleft\MakeUppercase{\chaptertitlename} \Huge\thechapter}
{1ex}
{\titlerule\vspace{1ex}\filright}
[\vspace{1ex}\titlerule]
}
% glossary stuff
\usepackage[acronyms,toc]{glossaries}
\setacronymstyle{long-short}
\loadglsentries{glossary}
\makenoidxglossaries{}
% Tikz stuff
\usepackage{tikz}
\usepackage{tikzpeople}
% used for nested box diagrams
\usetikzlibrary{positioning,fit,backgrounds}
% plotting things
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usetikzlibrary{intersections,decorations.markings}
\newcommand{\plotcurve}[3][thick, every plot/.style={smooth}]{
% plot curve y^2 = x^3 + a x + b in range [-3,3]^2
% parameter 1 (optional): style options for curve (color, etc)
% parameter 2: curve parameter a
% parameter 3: curve parameter b
\draw[gray] (-3,-3) rectangle (3,3);
\draw[->,>=latex,gray] (-3,0) -- (3,0);
\draw[->,>=latex,gray] (0,-3) -- (0,3);
\draw[name path=curve, #1] plot[id=curve#2#3, raw gnuplot] function {
f(x,y) = y**2 - x**3 - #2*x - #3;
set xrange [-3:3];
set yrange [-3:3];
set view 0,0;
set isosample 50,50;
set cont base;
set cntrparam levels incre 0,0.1,0;
unset surface;
splot f(x,y);
};
}
\tikzset{
tangent/.style={
decoration={markings, mark=at position #1 with {
\coordinate (tangent point-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,0pt);
\coordinate (tangent unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (1,0pt);
\coordinate (tangent orthogonal unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,1);
}},
postaction=decorate
},
use tangent/.style={
shift=(tangent point-#1),
x=(tangent unit vector-#1),
y=(tangent orthogonal unit vector-#1)
},
use tangent/.default=1
}
% crypgraphy stuff
\usepackage[operators, sets]{cryptocode}
\newcommand{\mathAdded}[1]{\textcolor{green!60!gray}{\mathbf{#1}}}
\newcommand{\textAdded}[1]{\textcolor{green!60!gray}{\textbf{#1}}}
% I hate quotes
\usepackage{csquotes}
% am bri'ish
\usepackage[british]{babel}
% cleverly decides how to reference a given ref
% must be loaded after hyperref and amsmath
\usepackage{cleveref}
% only work on a chapter at a time to improve compile times
% \includeonly{chapter3}
% \usepackage{showframe}
% % specify how the document should handle hyphenation at page borders
% \tolerance=1
% \emergencystretch=\maxdimen
% \hbadness=10000
% allow hyphenation inside of \texttt
\newcommand\textvtt[1]{{\normalfont\fontfamily{cmvtt}\selectfont #1}}
\title{Exploring Password-Authenticated Key-Exchange Algorithms}
\author{Sam Leonard}
\supervisor{Professor Bernardo Magri}
\reportyear{2023}
\studentid{10447494}
\abstractfile{abstract.tex}
\thanksfile{merci.tex}
\begin{document}
\PreContentTitleFormat
\dotitleandabstract
%% Generate contents etc
\tableofcontents
\medskip
\medskip
\textbf{Word count}: 10,845
%% These include the actual text
\ContentTitleFormat
\include{chapter1}
\include{chapter2}
\include{chapter3}
\include{chapter4}
\include{chapter5}
\include{chapter6}
% print the glossary
\PreContentTitleFormat
\printnoidxglossaries
% print the bibliography
\printbibliography{}
%% Appendices start here
\ContentTitleFormat
\appendix
\include{appendix1}
\include{appendix2}
\include{appendix3}
\include{appendix4}
\include{appendix5}
\end{document}