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

Function run

tests/fuzz/fuzz-codex32.c:171–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171void 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}

Callers

nothing calls this directly

Calls 5

codex32_decodeFunction · 0.85
codex32_secret_encodeFunction · 0.85
tal_bytelenFunction · 0.85
clean_tmpctxFunction · 0.85
to_stringFunction · 0.70

Tested by

no test coverage detected