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

Function hashBuffer

src/simplicity/bitcoin/env.c:19–23  ·  view source on GitHub ↗

Compute the SHA-256 hash of a scriptPubKey and write it into 'result'. * * Precondition: NULL != result; * NULL != scriptPubKey; */

Source from the content-addressed store, hash-verified

17 * NULL != scriptPubKey;
18 */
19static void hashBuffer(sha256_midstate* result, const rawBitcoinBuffer* buffer) {
20 sha256_context ctx = sha256_init(result->s);
21 sha256_uchars(&ctx, buffer->buf, buffer->len);
22 sha256_finalize(&ctx);
23}
24
25/* Initialize a 'sigOutput' from a 'rawOutput', copying or hashing the data as needed.
26 *

Callers 2

copyOutputFunction · 0.70
copyInputFunction · 0.70

Calls 3

sha256_initFunction · 0.85
sha256_ucharsFunction · 0.85
sha256_finalizeFunction · 0.85

Tested by

no test coverage detected