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