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

Function tmrIV

src/simplicity/type.c:11–19  ·  view source on GitHub ↗

Given a the 'kind' of a Simplicity type, return the SHA-256 hash of its associated TMR tag. * This is the "initial value" for computing the type Merkle root for that type. */

Source from the content-addressed store, hash-verified

9 * This is the "initial value" for computing the type Merkle root for that type.
10 */
11static sha256_midstate tmrIV(typeName kind) {
12 switch (kind) {
13 case ONE: return unitIV;
14 case SUM: return sumIV;
15 case PRODUCT: return prodIV;
16 }
17 /* Impossible to reach here (unless you call with uninitialized values). */
18 SIMPLICITY_UNREACHABLE;
19}
20
21/* Given a well-formed 'type_dag', compute the bitSizes, skips, and type Merkle roots of all subexpressions.
22 * For all 'i', 0 <= 'i' < 'len',

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected