simplicity_tapdata_init : ONE |- CTX8 */
| 1406 | |
| 1407 | /* simplicity_tapdata_init : ONE |- CTX8 */ |
| 1408 | bool 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 | } |
nothing calls this directly
no test coverage detected