output_hash : TWO^32 |- S TWO^256 */
| 1114 | |
| 1115 | /* output_hash : TWO^32 |- S TWO^256 */ |
| 1116 | bool simplicity_output_hash(frameItem* dst, frameItem src, const txEnv* env) { |
| 1117 | uint_fast32_t i = simplicity_read32(&src); |
| 1118 | if (writeBit(dst, i < env->tx->numOutputs)) { |
| 1119 | const sigOutput* output = &env->tx->output[i]; |
| 1120 | sha256_midstate midstate; |
| 1121 | sha256_context ctx = sha256_init(midstate.s); |
| 1122 | simplicity_sha256_confAsset(&ctx, &output->asset); |
| 1123 | simplicity_sha256_confAmt(&ctx, &output->amt); |
| 1124 | simplicity_sha256_confNonce(&ctx, &output->nonce); |
| 1125 | sha256_hash(&ctx, &output->scriptPubKey); |
| 1126 | sha256_hash(&ctx, &output->rangeProofHash); |
| 1127 | sha256_finalize(&ctx); |
| 1128 | writeHash(dst, &midstate); |
| 1129 | } else { |
| 1130 | skipBits(dst, 256); |
| 1131 | } |
| 1132 | return true; |
| 1133 | } |
| 1134 | |
| 1135 | /* input_outpoints_hash : ONE |- TWO^256 */ |
| 1136 | bool simplicity_input_outpoints_hash(frameItem* dst, frameItem src, const txEnv* env) { |
nothing calls this directly
no test coverage detected