2021-02-01 03:58:50 +01:00
|
|
|
#include "config.h"
|
2020-09-10 18:19:58 +02:00
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#include <common/base32.h>
|
|
|
|
#include <common/base64.h>
|
2023-04-03 08:41:04 +02:00
|
|
|
#include <tests/fuzz/libfuzz.h>
|
2020-09-10 18:19:58 +02:00
|
|
|
|
|
|
|
void init(int *argc, char ***argv)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void run(const uint8_t *data, size_t size)
|
|
|
|
{
|
|
|
|
char *encoded;
|
|
|
|
uint8_t *decoded;
|
|
|
|
|
|
|
|
encoded = b32_encode(NULL, data, size);
|
|
|
|
decoded = b32_decode(NULL, encoded, strlen(encoded));
|
|
|
|
assert(memcmp(decoded, data, size) == 0);
|
|
|
|
tal_free(encoded);
|
|
|
|
tal_free(decoded);
|
|
|
|
|
|
|
|
encoded = b64_encode(NULL, data, size);
|
|
|
|
tal_free(encoded);
|
|
|
|
}
|