| 153 | static struct privkey privkey; |
| 154 | |
| 155 | static bool test_sign(const u5 *u5bytes, |
| 156 | const u8 *hrpu8, |
| 157 | secp256k1_ecdsa_recoverable_signature *rsig, |
| 158 | void *unused UNUSED) |
| 159 | { |
| 160 | struct hash_u5 hu5; |
| 161 | char *hrp; |
| 162 | struct sha256 sha; |
| 163 | |
| 164 | hrp = tal_dup_arr(NULL, char, (char *)hrpu8, tal_count(hrpu8), 1); |
| 165 | hrp[tal_count(hrpu8)] = '\0'; |
| 166 | |
| 167 | hash_u5_init(&hu5, hrp); |
| 168 | hash_u5(&hu5, u5bytes, tal_count(u5bytes)); |
| 169 | hash_u5_done(&hu5, &sha); |
| 170 | tal_free(hrp); |
| 171 | |
| 172 | if (!secp256k1_ecdsa_sign_recoverable(secp256k1_ctx, rsig, |
| 173 | (const u8 *)&sha, |
| 174 | privkey.secret.data, |
| 175 | NULL, NULL)) |
| 176 | abort(); |
| 177 | |
| 178 | return true; |
| 179 | } |
| 180 | |
| 181 | static void test_b11(const char *b11str, |
| 182 | const struct bolt11 *expect_b11, |
nothing calls this directly
no test coverage detected