Write data to a Simplicity CTX8 type (TWO^8)^<2^64 * TWO^64 * TWO^256 from a sha256_context value. * Advance the 'dst' frame to the end of the CTX8 type. * Returns false if the ctx had overflowed. * * The notation X^<2 is notation for the type (S X) * The notation X^<(2*n) is notation for the type S (X^n) * X^<n * * Precondition: '*dst' is a valid write frame for 838 more cells; *
| 173 | * ctx->counter < 2^61; |
| 174 | */ |
| 175 | bool simplicity_write_sha256_context(frameItem* dst, const sha256_context* ctx) { |
| 176 | simplicity_write_buffer8(dst, ctx->block, ctx->counter % 64, 5); |
| 177 | simplicity_write64(dst, ctx->counter >> 6); |
| 178 | write32s(dst, ctx->output, 8); |
| 179 | return !ctx->overflow; |
| 180 | } |
| 181 | |
| 182 | /* Given a write frame and a read frame, copy 'n' cells from after the read frame's cursor to after the write frame's cursor, |
| 183 | * Cells in within the write frame beyond 'n' cells after the write frame's cursor may also be overwritten. |
no test coverage detected