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

Function initializeBitstream

src/simplicity/bitstream.h:28–30  ·  view source on GitHub ↗

Initialize a bit stream, 'stream', from a given byte array. * Precondition: unsigned char arr[len]; */

Source from the content-addressed store, hash-verified

26 * Precondition: unsigned char arr[len];
27 */
28static inline bitstream initializeBitstream(const unsigned char* arr, size_t len) {
29 return (bitstream){ .arr = arr, .len = len };
30}
31
32/* Closes a bitstream by consuming all remaining bits.
33 * Returns 'SIMPLICITY_ERR_BITSTREAM_TRAILING_BYTES' if CHAR_BIT or more bits remain in the stream.

Callers 8

test_decodeUptoMaxIntFunction · 0.85
test_hashBlockFunction · 0.85
test_programFunction · 0.85
test_occursCheckFunction · 0.85
exactBudget_testFunction · 0.85

Calls

no outgoing calls

Tested by 6

test_decodeUptoMaxIntFunction · 0.68
test_hashBlockFunction · 0.68
test_programFunction · 0.68
test_occursCheckFunction · 0.68
exactBudget_testFunction · 0.68