doc: update sha256 doc

This commit is contained in:
lohhiiccc 2026-05-07 16:46:49 +02:00
parent 3e36cb4906
commit 7ec4cfaede

View file

@ -89,6 +89,9 @@ W[i] = \begin{cases}
The state is initialized to fixed constants derived from the square roots of The state is initialized to fixed constants derived from the square roots of
the first eight prime numbers: the first eight prime numbers:
\begin{align*}
\forall (X,p)\in\{(A,2),(B,3),(C,5),(D,7),(E,11),(F,13),(G,17),(H,19)\}, X \leftarrow \left\lfloor \{\sqrt{p}\}\;2^{32}\right\rfloor
\end{align*}
\begin{align*} \begin{align*}
A &= \texttt{0x6a09e667}, \quad B = \texttt{0xbb67ae85}, \quad A &= \texttt{0x6a09e667}, \quad B = \texttt{0xbb67ae85}, \quad
C = \texttt{0x3c6ef372}, \quad D = \texttt{0xa54ff53a} \\ C = \texttt{0x3c6ef372}, \quad D = \texttt{0xa54ff53a} \\
@ -100,10 +103,11 @@ After each block is processed, the compressed state is added word-by-word to
the state before compression: the state before compression:
\begin{align*} \begin{align*}
(A, \ldots, H) \leftarrow (A + A_0,\ B + B_0,\ C + C_0,\ D + D_0,\ E + E_0,\ F + F_0,\ G + G_0,\ H + H_0) \forall X \in \{A, B, C, D, E, F, G ,H\}, \quad X \leftarrow X + X_0
\end{align*} \end{align*}
\noindent where $A_0, \ldots, H_0$ denote the state at the beginning of the
\noindent where $X_0$ denote the state at the beginning of the
block. After all blocks have been processed, the eight state words are block. After all blocks have been processed, the eight state words are
serialized in big-endian order to produce the 256-bit digest. serialized in big-endian order to produce the 256-bit digest.