diff --git a/algorithms.tex b/algorithms.tex index be8ec29a4533bc8ef439cfe6bec30a337415be28..b17c254418ef5944bdce375026b6019314e155b7 100644 --- a/algorithms.tex +++ b/algorithms.tex @@ -1,8 +1,22 @@ -\todo{dsprenkels: Elaborate these captions, especially \textsc{Red}} +\newcommand{\sbcaptionextra}{ + A rule (\rule{4ex}{0.4pt}) denotes a ``dead'' value, i.e.\ one + that has no meaning and is unused. + \textsc{Red} executes a coefficient-reduction chain. +} +\newcommand{\hcaptionextra}{ + \sbcaptionextra + The additions/subtractions with large constants + ($2^{32}p$, $4p$ and $2^{37}p$) + are to ensure that all the values + are in the positive domain after subtraction. +} \begin{algorithm}[h] -\caption{Algorithm for point addition for Curve13318 as implemented on the -Sandy Bridge microarchitecture.} +\caption{ + Algorithm for point addition for Curve13318 as implemented on the + Sandy Bridge microarchitecture. + \sbcaptionextra +} \label{alg:add_asm_sandybridge} \begin{algorithmic} \Procedure{Add}{$X_1$, $Y_1$, $Z_1$, $X_2$, $Y_2$, $Z_2$} @@ -23,8 +37,11 @@ Sandy Bridge microarchitecture.} \end{algorithm} \begin{algorithm}[h] -\caption{Algorithm for point doubling for Curve13318 as implemented on the -Sandy Bridge microarchitecture.} +\caption{ + Algorithm for point doubling for Curve13318 as implemented on the + Sandy Bridge microarchitecture. + \sbcaptionextra +} \label{alg:double_asm_sandybridge} \begin{algorithmic} \Procedure{Double}{$X$, $Y$, $Z$} @@ -45,8 +62,11 @@ Sandy Bridge microarchitecture.} \end{algorithm} \begin{algorithm}[h] -\caption{Algorithm for point addition for Curve13318 as implemented on the -Haswell microarchitecture.} +\caption{ + Algorithm for point addition for Curve13318 as implemented on the + Haswell microarchitecture. + \hcaptionextra +} \label{alg:add_asm_haswell} \begin{algorithmic} \Procedure{Add}{$X_1$, $Y_1$, $Z_1$, $X_2$, $Y_2$, $Z_2$} @@ -67,8 +87,11 @@ Haswell microarchitecture.} \end{algorithm} \begin{algorithm}[h] -\caption{Algorithm for point doubling for Curve13318 as implemented on the -Haswell microarchitecture.} +\caption{ + Algorithm for point doubling for Curve13318 as implemented on the + Haswell microarchitecture. + \hcaptionextra +} \label{alg:double_asm_haswell} \begin{algorithmic} \Procedure{Double}{$X$, $Y$, $Z$} diff --git a/gen_algorithms.py b/gen_algorithms.py index 7f89c48f2e006968d4c73587f16ab4d364b8720a..8a2e671e3ec4bf0a413d7fe17d81d6e8e5ec654d 100755 --- a/gen_algorithms.py +++ b/gen_algorithms.py @@ -572,6 +572,13 @@ h_add.write( ('v35', 'v13', 'v31'), ('v41', 'v13', 'v23'), )) +h_add.write(batch( + '+', + (None, None, None), + ('v39', 'v39', '2^{37}p'), + (None, None, None), + (None, None, None), +)) h_add.write(batch( '-', (None, None, None), @@ -720,6 +727,13 @@ h_double.write( ('v34', 'v_{4v_2}', 'v28'), (None, None, None), )) +h_double.write(batch( + '-', + ('v30', 'v30', '2^{37}p'), + (None, None, None), + (None, None, None), + (None, None, None), +)) h_double.write(batch( '-', ('v31', 'v15', 'v30'),