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

Function simplicity_calculateAsset

src/simplicity/elements/ops.c:99–108  ·  view source on GitHub ↗

Compute an Element's issuance Asset ID value from an entropy value. * A reimplementation of CalculateAsset from Element's 'issuance.cpp'. * * Precondition: NULL != entropy; */

Source from the content-addressed store, hash-verified

97 * Precondition: NULL != entropy;
98 */
99sha256_midstate simplicity_calculateAsset(const sha256_midstate* entropy) {
100 uint32_t block[16] = {0};
101 sha256_midstate result;
102
103 memcpy(&block[0], entropy->s, sizeof(entropy->s));
104 sha256_iv(result.s);
105 simplicity_sha256_compression(result.s, block);
106
107 return result;
108}
109
110/* Compute an Element's issuance Token ID value from an entropy value and an amount prefix.
111 * A reimplementation of CalculateReissuanceToken from Element's 'issuance.cpp'.

Callers 2

copyInputFunction · 0.85

Calls 1

sha256_ivFunction · 0.85

Tested by

no test coverage detected