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

Function hashBuffer

src/simplicity/elements/env.c:20–24  ·  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

18 * NULL != scriptPubKey;
19 */
20static void hashBuffer(sha256_midstate* result, const rawElementsBuffer* buffer) {
21 sha256_context ctx = sha256_init(result->s);
22 sha256_uchars(&ctx, buffer->buf, buffer->len);
23 sha256_finalize(&ctx);
24}
25
26/* Initialize a 'confidential' asset or 'confidential' nonce from an unsigned char array from a 'rawElementsTransaction'.
27 *

Callers 2

copyInputFunction · 0.70
copyOutputFunction · 0.70

Calls 3

sha256_initFunction · 0.85
sha256_ucharsFunction · 0.85
sha256_finalizeFunction · 0.85

Tested by

no test coverage detected