arnaucube
arnaucube/davinci-paperPublic Self-hosted repository
davinci-paper/v2/build/preamble-macros.tex
v2/build/preamble-macros.texRaw
  1% !TeX root = main.tex
  2
  3% Doc sytle
  4\setcounter{secnumdepth}{3} %enumerate sections up to depth 3 (subsubsection)
  5% Set the first-level itemize label to use math mode \bullet
  6\setlist[itemize,1]{label=$\bullet$}
  7
  8% Working directory
  9\newcommand{\definedir}[2]{\newcommand{#1}{#2}}
 10\definedir{\secs}{../sections}
 11\definedir{\figs}{../figures}
 12\definedir{\bib}{../bibliography}
 13
 14% Comments
 15\newcommand{\marta}[1]{\todo[size=\small, color=red!40]{\textbf{Marta}: #1}}
 16\newcommand{\martai}[1]{\todo[inline, size=\small, color=red!40]{\textbf{Marta}: #1}}
 17\newcommand{\pau}[1]{\todo[size=\small, color=blue!40]{\textbf{Pau}: #1}}
 18\newcommand{\paui}[1]{\todo[inline, size=\small, color=blue!40]{\textbf{Pau}: #1}}
 19\newcommand{\jordi}[1]{\todo[size=\small, color=green!40]{\textbf{Jordi}: #1}}
 20\newcommand{\jordii}[1]{\todo[inline, size=\small, color=green!40]{\textbf{Jordi}: #1}}
 21
 22% Freefootnote
 23\let\svthefootnote\thefootnote
 24\newcommand\freefootnote[1]{%
 25	\let\thefootnote\relax%
 26	\footnotetext{#1}%
 27	\let\thefootnote\svthefootnote%
 28}
 29
 30% Table of contents style
 31% Make section entries bold in ToC
 32\makeatletter
 33\renewcommand{\@dotsep}{4.5}
 34\renewcommand{\l@section}[2]{\addpenalty{\@secpenalty}
 35	\addvspace{1.0em plus 1pt}
 36	\@tempdima=1.5em
 37	\parindent \z@ \rightskip \@pnumwidth
 38	\parfillskip -\@pnumwidth
 39	{\leavevmode
 40		\advance\leftskip\@tempdima
 41		\hskip -\leftskip
 42		\bfseries #1\hfil \hbox to\@pnumwidth{\hss #2}}\par}
 43\makeatother
 44
 45% Colours
 46\definecolor{cred}{rgb}{1, 0.5, 0.5}
 47\definecolor{cgreen}{rgb}{0.5, 1, 0.5}
 48\definecolor{cblue}{rgb}{0.5, 0.5, 1}
 49
 50% Hyperref setup
 51%\hypersetup{
 52%	final=true,
 53%	colorlinks=true,
 54%	linkcolor=cblue,
 55%	urlcolor=black,
 56%	citecolor=cblue,
 57%}
 58
 59% Mathbb
 60\newcommand{\N}{\ensuremath{\mathbb{N}}\xspace}
 61\newcommand{\Z}{\ensuremath{\mathbb{Z}}\xspace}
 62\newcommand{\G}{\ensuremath{\mathbb{G}}\xspace}
 63\newcommand{\F}{\ensuremath{\mathbb{F}}\xspace}
 64\newcommand{\J}{\ensuremath{\mathbb{J}}\xspace}
 65
 66% Elliptic curves
 67\newcommand{\BW}[1]{\ensuremath{{#1}^{\text{\tiny \sf BW}}}\xspace}
 68\newcommand{\BLS}[1]{\ensuremath{{#1}^{\text{\tiny \sf BLS}}}\xspace}
 69\newcommand{\BN}[1]{\ensuremath{{#1}^{\text{\tiny \sf BN}}}\xspace}
 70
 71% Circuits
 72\newcommand{\public}{{\sf\color{teal}public}\xspace}
 73\newcommand{\private}{{\sf\color{red}private}\xspace}
 74
 75% Ballot protocol
 76\newcommand{\ballotstyle}[1]{\texttt{#1}\xspace}
 77\newcommand{\maxcount}{\ballotstyle{maxCount}}
 78\newcommand{\maxvalue}{\ballotstyle{maxValue}}
 79\newcommand{\minvalue}{\ballotstyle{minValue}}
 80\newcommand{\uniquevalues}{\ballotstyle{uniqueValues}}
 81\newcommand{\maxtotalcost}{\ballotstyle{maxTotalCost}}
 82\newcommand{\mintotalcost}{\ballotstyle{minTotalCost}}
 83\newcommand{\costexponent}{\ballotstyle{costExponent}}
 84
 85% Voting protocol
 86\newcommand{\variablestyle}[1]{\texttt{#1}\xspace}
 87\newcommand{\vote}{\variablestyle{vote}}
 88\newcommand{\processid}{\variablestyle{processID}}
 89\newcommand{\censuspf}{\variablestyle{censusProof}}
 90\newcommand{\commitment}{\variablestyle{identityCommitment}}
 91\newcommand{\nullifier}{\variablestyle{nullifier}}
 92\newcommand{\encryptedballot}{\variablestyle{encryptedBallot}}
 93\newcommand{\zkproof}{\variablestyle{ZKproof}}
 94\newcommand{\signature}{\variablestyle{signature}}
 95\newcommand{\address}{\variablestyle{address}}
 96
 97% State Merkle tree
 98\newcommand{\censusroot}{\variablestyle{censusRoot}}
 99\newcommand{\type}{\variablestyle{type}}
100\newcommand{\ballotmode}{\variablestyle{ballotMode}}
101\newcommand{\epk}{\variablestyle{encryptionKey}}
102\newcommand{\addaccumulator}{\variablestyle{addedResultsAccumulator}}
103\newcommand{\substractaccumulator}{\variablestyle{substractResultsAccumulator}}
104\newcommand{\addresses}{\variablestyle{addresses}}
105\newcommand{\nullifiers}{\variablestyle{nullifiers}}
106\newcommand{\weight}{\variablestyle{weight}}
107
108% Others
109\newcommand{\noi}{\noindent}
110\newcommand{\conc}{\:||\:}
111
112% Hyperlinks
113\newcommand{\hlset}[1]{\hypertarget{\detokenize{#1}}{#1}}
114\newcommand{\hlget}[1]{\hyperlink{\detokenize{#1}}{#1}}
115
116% Cryptographic primitives
117\newcommand{\methodstyle}[1]{{\sf{#1}}\xspace}
118\newcommand{\Hash}{\methodstyle{Hash}}
119\newcommand{\Enc}{\methodstyle{Enc}}
120\newcommand{\Dec}{\methodstyle{Dec}}
121\newcommand{\GenerateShares}{\methodstyle{GenerateShares}}
122\newcommand{\VerifyShare}{\methodstyle{VerifyShare}}
123\newcommand{\DerivePublicKey}{\methodstyle{DerivePublicKey}}
124\newcommand{\DeriveSecretShare}{\methodstyle{DeriveSecretShare}}
125
126\newcommand{\blinder}[1][]{{\sf{blinder}^{#1}}}
127\newcommand{\pk}[1][]{{\sf{pk}^{#1}}}
128\newcommand{\sk}[1][]{{\sf{sk}^{#1}}} 
129\newcommand{\msg}[1][]{{\sf{message}^{#1}}}
130\newcommand{\enc}[1][]{{\sf{ciphertext}^{#1}}}
131\newcommand{\sample}{\xleftarrow{\$}}
132
133% VOC token
134\newcommand{\token}{VOC\xspace}
135\newcommand{\vocstyle}[1]{{\sf{#1}}\xspace}
136\newcommand{\baseCost}{\vocstyle{baseCost}}
137\newcommand{\capacityCost}{\vocstyle{capacityCost}}
138\newcommand{\durationCost}{\vocstyle{durationCost}}
139\newcommand{\fixedCost}{\vocstyle{fixedCost}}
140\newcommand{\maxVotes}{\vocstyle{maxVotes}}
141\newcommand{\maxDuration}{\vocstyle{maxDuration}}
142\newcommand{\numSequencers}{\vocstyle{numSequencers}}
143\newcommand{\processDuration}{\vocstyle{processDuration}}
144\newcommand{\reimbursement}{\vocstyle{reimbursement}}
145\newcommand{\securityCost}{\vocstyle{securityCost}}
146\newcommand{\sequencerReward}{\vocstyle{sequencerReward}}
147\newcommand{\slashedAmount}{\vocstyle{slashedAmount}}
148\newcommand{\stakedCollateral}{\vocstyle{stakedCollateral}}
149\newcommand{\totalCost}{\vocstyle{totalCost}}
150\newcommand{\totalReward}{\vocstyle{totalReward}}
151\newcommand{\totalRewrites}{\vocstyle{totalRewrites}}
152\newcommand{\totalSequencers}{\vocstyle{totalSequencers}}
153\newcommand{\totalVotingProcesses}{\vocstyle{totalVotingProcesses}}
154\newcommand{\usedSequencers}{\vocstyle{usedSequencers}}
155\newcommand{\votes}{\vocstyle{votes}}
156\newcommand{\voteRewrites}{\vocstyle{voteRewrites}}
157
158% Misc
159\newcommand{\davinci}{DAVINCI\xspace}
160\newcommand{\Davinci}{DAVINCI\xspace}
161
162% Draft watermark
163%\ifdraft{\SetWatermarkScale{4}}{\SetWatermarkScale{0}}
164
165% New foonote referencing a previous footmark
166\makeatletter
167\newcommand\footnoteref[1]{\protected@xdef\@thefnmark{\ref{#1}}\@footnotemark}
168\makeatother