Skip to content

Commit

Permalink
Fix some typos I noticed in the Programming Cryptol book. (#1631)
Browse files Browse the repository at this point in the history
- p-1 bits in an IEEE float refers to the significand, not the
  mantissa, at least according to the latest preferred terminology,
  which aims to keep the word "mantissa" for the full mantissa
  including the units bit;
- reciprocal rather than reciprocol;
- the example in 1.23 had the wrong module declarations; also insert a
  separator word between the verbatim blocks so they can be told
  apart.
  • Loading branch information
sauclovian-g committed Feb 23, 2024
1 parent 707257e commit facc682
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/ProgrammingCryptol/crashCourse/CrashCourse.tex
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ \section{Floating Point Numbers}

The family of types \texttt{Float e p}\indTheFloatType represent IEEE 754
floating point numbers with \texttt{e} bits in the exponent and
\texttt{p-1} bits in the mantissa. The family is defined in a built-in
\texttt{p-1} bits in the significand. The family is defined in a built-in
module called \texttt{Float} so to use it you'd need to either import
it in your Cryptol specification or use \texttt{:m Float} on the
Cryptol REPL.
Expand Down Expand Up @@ -3206,7 +3206,7 @@ \section{Type classes}\indTypeClasses
The \texttt{Field} typeclass represents values that, in addition to
being a \texttt{Ring}, have multiplictive inverses.
It includes the field division operation \texttt{/.} and the
\texttt{recip} operation for computing the reciprocol of a value.
\texttt{recip} operation for computing the reciprocal of a value.
Currently, only type \texttt{Rational} is a member of this class.

\item
Expand Down Expand Up @@ -3598,6 +3598,7 @@ \section{Program structure with modules}
accordingly:

\begin{verbatim}
module Hash::SHA3 where
sha3 : {n} (fin n) => [n] -> [512]
sha3 = error "Stubbed, for demonstration only: sha3-512"
Expand All @@ -3606,8 +3607,10 @@ \section{Program structure with modules}
blocksize = 576
\end{verbatim}

and

\begin{verbatim}
module Hash::SHA3 where
module HMAC where
import Hash::SHA3
hmac : {keySize, msgSize} (fin keySize, fin msgSize) => [keySize] -> [msgSize] -> [512]
Expand Down

0 comments on commit facc682

Please sign in to comment.