MCPcopy Create free account
hub / github.com/ElementsProject/elements / Round

Function Round

src/simplicity/sha256.c:29–34  ·  view source on GitHub ↗

One round of SHA-256. * * Precondition: NULL != d * NULL != h * d != h */

Source from the content-addressed store, hash-verified

27 * d != h
28 */
29static inline 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) {
30 uint32_t t1 = 1U * *h + Sigma1(e) + Ch(e, f, g) + k;
31 uint32_t t2 = 1U * Sigma0(a) + Maj(a, b, c);
32 *d = 1U * *d + t1;
33 *h = 1U * t1 + t2;
34}
35
36/* Given a 256-bit 's' and a 512-bit 'chunk', then 's' becomes the value of the SHA-256 compression function ("added" to the original 's' value).
37 *

Callers 2

Calls 4

Sigma1Function · 0.70
ChFunction · 0.70
Sigma0Function · 0.70
MajFunction · 0.70

Tested by

no test coverage detected