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

Function ReadBE32

src/simplicity/sha256.h:34–39  ·  view source on GitHub ↗

Packs (the 8 least significant bits of) 4 'unsigned char's into a 'uint32_t' in "big endian" order. * * Precondition: unsigned char b[4] */

Source from the content-addressed store, hash-verified

32 * Precondition: unsigned char b[4]
33 */
34static inline uint32_t ReadBE32(const unsigned char* b) {
35 return (uint32_t)(b[0]) << 24
36 | (uint32_t)(b[1] & 0xff) << 16
37 | (uint32_t)(b[2] & 0xff) << 8
38 | (uint32_t)(b[3] & 0xff);
39}
40
41/* Unpacks the 8 least significant bytes from a 'uint_fast64_t' into an 'unsigned char' array in "big endian" order.
42 *

Callers 2

sha256_toMidstateFunction · 0.70
sha256_compression_ucharFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected