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

Function nonce

src/simplicity/elements/elementsJets.c:70–81  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

68 * NULL != nonce;
69 */
70static void nonce(frameItem* dst, const confidential* nonce) {
71 if (writeBit(dst, NONE != nonce->prefix)) {
72 if (writeBit(dst, EXPLICIT == nonce->prefix)) {
73 skipBits(dst, 1);
74 } else {
75 writeBit(dst, ODD_Y == nonce->prefix);
76 }
77 writeHash(dst, &nonce->data);
78 } else {
79 skipBits(dst, 1+1+256);
80 }
81}
82
83/* Write an optional 'blindingNonce' from an 'assetIssuance' to the 'dst' frame, advancing the cursor 257 cells.
84 *

Callers 1

simplicity_output_nonceFunction · 0.85

Calls 3

writeBitFunction · 0.85
skipBitsFunction · 0.85
writeHashFunction · 0.70

Tested by

no test coverage detected