Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appendix for cryptographic algorithms #1389

Merged
merged 1 commit into from Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion shelley/chain-and-ledger/formal-spec/cddl.tex
Expand Up @@ -5,4 +5,8 @@ \section{CBOR Serialization Specification}
serialization scheme is specified using
CDDL (RFC 8610 \cite{rfcCDDL}).

\lstinputlisting[backgroundcolor = \color{lightgray}]{../executable-spec/cddl-files/shelley.cddl}
The CDDL specification is located at
\url{https://github.com/input-output-hk/cardano-ledger-specs/tree/master/shelley/chain-and-ledger/executable-spec/cddl-files}.

% TODO - Include the CDDL spec inline?
% \lstinputlisting[backgroundcolor = \color{lightgray}]{../executable-spec/cddl-files/shelley.cddl}
27 changes: 27 additions & 0 deletions shelley/chain-and-ledger/formal-spec/crypto-details.tex
@@ -0,0 +1,27 @@
\section{Cryptographic Details}
\label{sec:crypto-details}

\subsection{Hashing}
The hashing algorithm for payment and stake credentials (Figure~\ref{fig:defs:addresses}),
is BLAKE2b-224.
Everywhere else we use BLAKE2b-256.
In the CDDL specification in Appendix~\ref{sec:cddl},
$\mathsf{hash28}$ refers to BLAKE2b-224 and
and $\mathsf{hash32}$ refers to BLAKE2b-256.
BLAKE2 is specified in RFC 7693 \cite{rfcBLAKE2}.

\subsection{Addresses}
The \fun{sign} and \fun{verify} functions from Figure~\ref{fig:crypto-defs-shelley}
use Ed25519. See \cite{rfcEdDSA}.

\subsection{KES}
The \fun{sign_{ev}} and \fun{verify_{ev}} functions from Figure~\ref{fig:kes-defs-shelley}
use the iterated sum construction from Section 3.1 of \cite{cryptoeprint:2001:034}.
We allow up to $2^7$ key evolutions, which is larger than the maximum number
of evolutions allow by the spec, \MaxKESEvo, which will be set to $90$.
See Figure~\ref{fig:rules:ocert}.

\subsection{VRF}
The \fun{verifyVrf} function from Figure~\ref{fig:defs-vrf}
uses ECVRF-ED25519-SHA512-Elligator2 as described in the draft IETF specification
\cite{rfcVRFDraft}.
4 changes: 2 additions & 2 deletions shelley/chain-and-ledger/formal-spec/ledger-spec.tex
Expand Up @@ -313,8 +313,8 @@

\clearpage
\begin{appendix}
% \input{cddl}
% ^^ TODO figure out how to get relative imports (../executable-spec/cddl-files/shelley.cddl) to work in nix
\input{crypto-details}
\input{cddl}
\input{proofs}
\end{appendix}

Expand Down
47 changes: 44 additions & 3 deletions shelley/chain-and-ledger/formal-spec/references.bib
Expand Up @@ -179,7 +179,7 @@ @article{DBLP:journals/tcs/Escardo96

@techreport{rfcCBOR,
author = {C. Bormann},
title = {Concise Binary Object Representation (CBOR)},
title = {Concise {B}inary {O}bject {R}epresentation ({CBOR})},
howpublished = {Internet Requests for Comments},
type = {RFC},
number = 7049,
Expand All @@ -191,10 +191,9 @@ @techreport{rfcCBOR
url = {https://tools.ietf.org/html/rfc7049}
}


@techreport{rfcCDDL,
author = {H. Birkholz},
title = {Concise Data Definition Language (CDDL)},
title = {Concise {D}ata {D}efinition {L}anguage ({CDDL})},
howpublished = {Internet Requests for Comments},
type = {RFC},
number = 8610,
Expand All @@ -205,3 +204,45 @@ @techreport{rfcCDDL
institution = {RFC Editor},
url = {https://tools.ietf.org/html/rfc8610}
}

@techreport{rfcBLAKE2,
author = {M-J. Saarinen},
title = {The {BLAKE2} Cryptographic Hash and Message Authentication Code ({MAC})},
howpublished = {Internet Requests for Comments},
type = {RFC},
number = 7693,
year = {2015},
month = {11},
issn = {2070-1721},
publisher = {RFC Editor},
institution = {RFC Editor},
url = {https://tools.ietf.org/html/rfc7693}
}

@techreport{rfcEdDSA,
author = {S. Josefsson},
title = {Edwards-{C}urve {D}igital {S}ignature {A}lgorithm ({EdDSA})},
howpublished = {Internet Requests for Comments},
type = {RFC},
number = 8032,
year = {2017},
month = {1},
issn = {2070-1721},
publisher = {RFC Editor},
institution = {RFC Editor},
url = {https://tools.ietf.org/html/rfc8032}
}

@techreport{rfcVRFDraft,
author = {S. Goldberg},
title = {Verifiable {R}andom {F}unctions ({VRFs}), draft-irtf-cfrg-vrf-06},
howpublished = {Internet Requests for Comments},
type = {RFC},
number = {draft},
year = {2020},
month = {2},
issn = {2070-1721},
publisher = {RFC Editor},
institution = {RFC Editor},
url = {https://tools.ietf.org/html/draft-irtf-cfrg-vrf-06}
}