MCPcopy Create free account
hub / github.com/ElementsProject/lightning / print_signature

Function print_signature

devtools/bolt12-cli.c:314–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314static bool print_signature(const char *messagename,
315 const char *fieldname,
316 const struct tlv_field *fields,
317 const struct pubkey *node_id,
318 const struct bip340sig *sig)
319{
320 struct sha256 m, shash;
321
322 /* No key, it's already invalid */
323 if (!node_id)
324 return false;
325
326 merkle_tlv(fields, &m);
327 sighash_from_merkle(messagename, fieldname, &m, &shash);
328 if (!check_schnorr_sig(&shash, &node_id->pubkey, sig)) {
329 fprintf(stderr, "%s: INVALID\n", fieldname);
330 return false;
331 }
332 printf("%s: %s\n",
333 fieldname,
334 fmt_bip340sig(tmpctx, sig));
335 return true;
336}
337
338static void print_recurrence_counter(const u32 *recurrence_counter,
339 const u32 *recurrence_start)

Callers 1

mainFunction · 0.85

Calls 4

check_schnorr_sigFunction · 0.85
fmt_bip340sigFunction · 0.85
merkle_tlvFunction · 0.50
sighash_from_merkleFunction · 0.50

Tested by

no test coverage detected