24 RCSIDH(base32_h,
"$Id: 7252ea2075dfae504500b340ca5e53e33d79c6a3 $")
30 #include <freeradius-devel/missing.h>
31 #include <freeradius-devel/util/sbuff.h>
32 #include <freeradius-devel/util/dbuff.h>
37 #include <sys/types.h>
56 return alphabet[(
uint8_t)c] < 32;
60 bool add_padding,
char const alphabet[
static UINT8_MAX]);
62 #define fr_base32_encode(_out, _in, _add_padding) \
63 fr_base32_encode_nstd(_out, _in, _add_padding, fr_base32_alphabet_encode)
66 bool expect_padding,
bool no_trailing,
uint8_t const alphabet[
static UINT8_MAX])
69 #define fr_base32_decode(_out, _in, _expect_padding, _no_trailing) \
70 fr_base32_decode_nstd(NULL, _out, _in, _expect_padding, _no_trailing, fr_base32_alphabet_decode)
char const fr_base32_alphabet_encode[UINT8_MAX]
Encode/decode binary data using printable characters (base32 format)
ssize_t fr_base32_encode_nstd(fr_sbuff_t *out, fr_dbuff_t *in, bool add_padding, char const alphabet[static UINT8_MAX])
Base 64 encode binary data.
uint8_t const fr_base32_alphabet_decode[UINT8_MAX]
ssize_t fr_base32_decode_nstd(fr_sbuff_parse_error_t *err, fr_dbuff_t *out, fr_sbuff_t *in, bool expect_padding, bool no_trailing, uint8_t const alphabet[static UINT8_MAX]))
static bool fr_is_base32_nstd(char c, uint8_t const alphabet[static UINT8_MAX])
Check if char is in base32 alphabet.
uint8_t const fr_base32_hex_alphabet_decode[UINT8_MAX]
char const fr_base32_hex_alphabet_encode[UINT8_MAX]
static size_t char ** out