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

Function Ch

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

Multiplying a uint32_t by 1U promotes a value's type to the wider of unsigned int and uint32_t, * avoiding any possible issues with signed integer promotions causing havoc with unsigned modular arithmetic. */

Source from the content-addressed store, hash-verified

14 * avoiding any possible issues with signed integer promotions causing havoc with unsigned modular arithmetic.
15 */
16static inline uint32_t Ch(uint32_t x, uint32_t y, uint32_t z) { return z ^ (x & (y ^ z)); }
17static inline uint32_t Maj(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (z & (x | y)); }
18static inline uint32_t Sigma0(uint32_t x) { return (x >> 2 | 1U * x << 30) ^ (x >> 13 | 1U * x << 19) ^ (x >> 22 | 1U * x << 10); }
19static inline uint32_t Sigma1(uint32_t x) { return (x >> 6 | 1U * x << 26) ^ (x >> 11 | 1U * x << 21) ^ (x >> 25 | 1U * x << 7); }

Callers 1

RoundFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected