| 169 | } |
| 170 | |
| 171 | void run(const uint8_t *data, size_t size) |
| 172 | { |
| 173 | struct codex32 *c32; |
| 174 | char *str, *fail, *bip93; |
| 175 | |
| 176 | str = to_string(tmpctx, data, size); |
| 177 | |
| 178 | c32 = codex32_decode(tmpctx, NULL, str, &fail); |
| 179 | assert(c32 || fail); |
| 180 | |
| 181 | /* codex32_decode can decode HRPs of any length, but codex32_encode |
| 182 | * requires that strlen(HRP) == 2, so we enforce it here. */ |
| 183 | if (c32 && strlen(c32->hrp) == 2) { |
| 184 | const char *ret = codex32_secret_encode(tmpctx, c32->hrp, c32->id, c32->threshold, |
| 185 | c32->payload, tal_bytelen(c32->payload), &bip93); |
| 186 | assert(!ret && bip93); |
| 187 | } |
| 188 | |
| 189 | clean_tmpctx(); |
| 190 | } |
nothing calls this directly
no test coverage detected