| 18 | static struct privkey privkey; |
| 19 | |
| 20 | static bool test_sign(const u5 *u5bytes, |
| 21 | const u8 *hrpu8, |
| 22 | secp256k1_ecdsa_recoverable_signature *rsig, |
| 23 | void *unused UNUSED) |
| 24 | { |
| 25 | struct hash_u5 hu5; |
| 26 | char *hrp; |
| 27 | struct sha256 sha; |
| 28 | |
| 29 | hrp = tal_dup_arr(NULL, char, (char *)hrpu8, tal_count(hrpu8), 1); |
| 30 | hrp[tal_count(hrpu8)] = '\0'; |
| 31 | |
| 32 | hash_u5_init(&hu5, hrp); |
| 33 | hash_u5(&hu5, u5bytes, tal_count(u5bytes)); |
| 34 | hash_u5_done(&hu5, &sha); |
| 35 | tal_free(hrp); |
| 36 | |
| 37 | if (!secp256k1_ecdsa_sign_recoverable(secp256k1_ctx, rsig, |
| 38 | (const u8 *)&sha, |
| 39 | privkey.secret.data, |
| 40 | NULL, NULL)) |
| 41 | abort(); |
| 42 | |
| 43 | return true; |
| 44 | } |
| 45 | |
| 46 | static void test_b11(const char *b11str, |
| 47 | const struct bolt11 *expect_b11, |
nothing calls this directly
no test coverage detected