Files
Chandra Pratap e721b0a89a fuzz-tests: Enhance b64_encode() validation with roundtrip decoding
Changelog-None: Currently, fuzz testing for b64_encode() merely
encodes input and frees the result, providing no real verification
of its behavior.

Introduce a new b64_decode() function (modeled after b32_decode())
and update the fuzz test to perform a roundtrip—encoding followed
by decoding—to ensure that b64_encode() correctly preserves the
original data.
2025-07-08 12:54:56 +09:30

11 lines
326 B
C

#ifndef LIGHTNING_COMMON_BASE64_H
#define LIGHTNING_COMMON_BASE64_H
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <ccan/tal/tal.h>
char *b64_encode(const tal_t *ctx, const void *data, size_t len);
u8 *b64_decode(const tal_t *ctx, const char *str, size_t len);
#endif /* LIGHTNING_COMMON_BASE64_H */