Compute an Element's issuance Asset ID value from an entropy value. * A reimplementation of CalculateAsset from Element's 'issuance.cpp'. * * Precondition: NULL != entropy; */
| 97 | * Precondition: NULL != entropy; |
| 98 | */ |
| 99 | sha256_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'. |
no test coverage detected