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

Function simplicity_tapdata_init

src/simplicity/jets.c:1408–1425  ·  view source on GitHub ↗

simplicity_tapdata_init : ONE |- CTX8 */

Source from the content-addressed store, hash-verified

1406
1407/* simplicity_tapdata_init : ONE |- CTX8 */
1408bool simplicity_tapdata_init(frameItem* dst, frameItem src, const txEnv* env) {
1409 (void) env; /* env is unused. */
1410 (void) src; /* env is unused. */
1411
1412 sha256_midstate tapleafTag;
1413 {
1414 static const unsigned char tagName[] = "TapData";
1415 sha256_context ctx = sha256_init(tapleafTag.s);
1416 sha256_uchars(&ctx, tagName, sizeof(tagName) - 1);
1417 sha256_finalize(&ctx);
1418 }
1419 uint32_t iv[8];
1420 sha256_context ctx = sha256_init(iv);
1421 sha256_hash(&ctx, &tapleafTag);
1422 sha256_hash(&ctx, &tapleafTag);
1423
1424 return simplicity_write_sha256_context(dst, &ctx);
1425}

Callers

nothing calls this directly

Calls 5

sha256_initFunction · 0.85
sha256_ucharsFunction · 0.85
sha256_finalizeFunction · 0.85
sha256_hashFunction · 0.85

Tested by

no test coverage detected