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

Function simplicity_sha_256_ctx_8_add_buffer_511

src/simplicity/jets.c:1355–1367  ·  view source on GitHub ↗

sha_256_ctx_8_add_buffer_511 : CTX8 * (TWO^8)^<512 |- CTX8 * where * CTX8 = (TWO^8)^<64 * TWO^64 * TWO^256 */

Source from the content-addressed store, hash-verified

1353 * CTX8 = (TWO^8)^<64 * TWO^64 * TWO^256
1354 */
1355bool simplicity_sha_256_ctx_8_add_buffer_511(frameItem* dst, frameItem src, const txEnv* env) {
1356 (void) env; /* env is unused. */
1357 sha256_midstate midstate;
1358 unsigned char buf[511];
1359 size_t buf_len;
1360 sha256_context ctx = {.output = midstate.s};
1361
1362 if (!simplicity_read_sha256_context(&ctx, &src)) return false;
1363
1364 simplicity_read_buffer8(buf, &buf_len, &src, 8);
1365 sha256_uchars(&ctx, buf, buf_len);
1366 return simplicity_write_sha256_context(dst, &ctx);
1367}
1368
1369/* sha_256_ctx_8_finalize : CTX8 |- TWO^256
1370 * where

Callers

nothing calls this directly

Calls 4

simplicity_read_buffer8Function · 0.85
sha256_ucharsFunction · 0.85

Tested by

no test coverage detected