You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/crypt.tex
+27Lines changed: 27 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7629,6 +7629,33 @@ \subsection{Argon2}
7629
7629
The function returns \texttt{CRYPT\_OK} on success, \texttt{CRYPT\_MEM} if memory allocation fails, or \texttt{CRYPT\_INVALID\_ARG} if any parameter is out of range.
7630
7630
7631
7631
7632
+
\subsection{scrypt}
7633
+
\index{scrypt}
7634
+
\label{scrypt}
7635
+
7636
+
scrypt is a memory-hard password-based key derivation function defined in \href{https://datatracker.ietf.org/doc/html/rfc7914}{\texttt{RFC 7914}}.
7637
+
It is designed so that a large amount of memory is required for evaluation, making hardware brute-force attacks more costly.
7638
+
Internally it uses PBKDF2-HMAC-SHA-256 and a reduced-round Salsa20 core.
7639
+
7640
+
To enable scrypt, define \texttt{LTC\_SCRYPT} in \textit{tomcrypt\_custom.h} (it also requires \texttt{LTC\_PKCS\_5} and \texttt{LTC\_SHA256}).
7641
+
7642
+
\index{scrypt\_pbkdf()}
7643
+
\begin{alltt}
7644
+
int scrypt_pbkdf(const unsigned char *password, unsigned long password_len,
7645
+
const unsigned char *salt, unsigned long salt_len,
7646
+
unsigned long N, unsigned long r, unsigned long p,
7647
+
unsigned char *out, unsigned long outlen);
7648
+
\end{alltt}
7649
+
7650
+
The \textit{password} parameter is the password of length \textit{password\_len}.
7651
+
The \textit{salt} parameter is a random salt of length \textit{salt\_len}.
7652
+
The \textit{N} parameter is the CPU/memory cost; it must be greater than 1 and a power of 2.
7653
+
The \textit{r} parameter is the block size (minimum 1; a typical value is 8).
7654
+
The \textit{p} parameter is the parallelisation factor (minimum 1); this implementation is single-threaded, so increasing \textit{p} raises the computational cost without improving performance.
7655
+
The derived key of length \textit{outlen} is written to \textit{out}.
7656
+
The function returns \texttt{CRYPT\_OK} on success or an error code on failure.
0 commit comments