From 161c9d05f80e5bf420a240efda501dc0d112c7f2 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Fri, 20 Mar 2020 15:31:26 +0000 Subject: [PATCH] Protocol spec: \hexints and \hexarray macros. Signed-off-by: Daira Hopwood --- protocol/protocol.tex | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/protocol/protocol.tex b/protocol/protocol.tex index 87f15ec0..d3efcc37 100644 --- a/protocol/protocol.tex +++ b/protocol/protocol.tex @@ -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)\!} +% +\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.}