Protocol spec: \hexints and \hexarray macros.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2020-03-20 15:31:26 +00:00
parent 9d7f700c35
commit 161c9d05f8
1 changed files with 9 additions and 1 deletions

View File

@ -1203,6 +1203,14 @@ electronic commerce and payment, financial privacy, proof of work, zero knowledg
\newcommand{\maybe}[1]{{#1} \union \setof{\bot}}
\newcommand{\Of}[1]{\!\left({#1}\right)\!}
% <https://tex.stackexchange.com/a/87423/78411>
\newcommand{\hexints}[1]{
\def\nextitem{\def\nextitem{, }}
\renewcommand*{\do}[1]{\nextitem\hexint{##1}}
\docsvlist{#1}
}
\newcommand{\hexarray}[1]{[\,\hexints{#1}\,]}
% Hashes
@ -2451,7 +2459,7 @@ digits means the corresponding integer converted from hexadecimal.
$\ascii{...}$ means the given string represented as a
sequence of bytes in US-ASCII. For example, $\ascii{abc}$ represents the
byte sequence $[\hexint{61}, \hexint{62}, \hexint{63}]$.
byte sequence $\hexarray{61,62,63}$.
$\zeros{\ell}$ means the sequence of $\ell$ zero bits.
\notsprout{$\ones{\ell}$ means the sequence of $\ell$ one bits.}