Blockchain and sha256 [6], Round

投稿者: | 01/24/2022

void Round(uint32_t a, uint32_t b, uint32_t c, uint32_t& d, uint32_t e, uint32_t f, uint32_t g, uint32_t& h, uint32_t k)
uint32_t t1 = h + Sigma1(e) + Ch(e, f, g) + k;
uint32_t t2 = Sigma0(a) + Maj(a, b, c);
d += t1;
h = t1 + t2;

Since the 4th and 8th arguments are references, these are the output.
And the 9th argument is the input.
Even if it looks complicated like this, the return value of Sigma1, Sigma0, Ch, and Maj are uint32_t.
Therefore, it will always be uint32_t.
By the way, when solving complex integer problem(of cource 3n+1 conjecture too),
matrices and complex function,
there is a method that is often used to “replace complex parts with variable”.
e.g. Diagonalization matrices and imaginary number are typical examples.
Let’s make sha256 easier by doing so.

このように、複雑に見えても、Sigma1, Sigma0, Ch, Majの戻り値はuint32_tです。