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

Function amt

src/simplicity/elements/elementsJets.c:55–63  ·  view source on GitHub ↗

Write an confidential amount to the 'dst' frame, advancing the cursor 258 cells. * * Precondition: '*dst' is a valid write frame for 258 more cells; * NULL != amt; */

Source from the content-addressed store, hash-verified

53 * NULL != amt;
54 */
55static void amt(frameItem* dst, const confAmount* amt) {
56 if (writeBit(dst, EXPLICIT == amt->prefix)) {
57 skipBits(dst, 1 + 256 - 64);
58 simplicity_write64(dst, amt->explicit);
59 } else {
60 writeBit(dst, ODD_Y == amt->prefix);
61 writeHash(dst, &amt->confidential);
62 }
63}
64
65/* Write an optional confidential nonce to the 'dst' frame, advancing the cursor 259 cells.
66 *

Callers 5

issuanceAssetAmtFunction · 0.85
issuanceTokenAmtFunction · 0.85
simplicity_input_amountFunction · 0.85
simplicity_output_amountFunction · 0.85

Calls 3

writeBitFunction · 0.85
skipBitsFunction · 0.85
writeHashFunction · 0.70

Tested by

no test coverage detected