summaryrefslogtreecommitdiff
path: root/modules/base32
Commit message (Collapse)AuthorAgeFilesLines
* base32, base64: fix broken testsPaul Eggert2021-08-291-1/+0
| | | | | | | | | | | | Problem reported by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2021-08/msg00170.html * lib/base32.c, lib/base64.c: Do not include verify.h, and omit all uses of ‘assume’. * modules/base32, modules/base64 (Depends-on): Remove verify. * tests/test-base32.c, tests/test-base64.c: Don’t pass out-of-range values to allocator, as converting them to idx_t relies on implementation-defined behavior that could trap.
* base32, base64: prefer signed to unsigned integersPaul Eggert2021-08-271-0/+2
| | | | | | | | | | | | | | | | | | | | * lib/base32.c, lib/base64.c: Include ialloc.h instad of stdlib.h. Include intprops.h, verify.h. * lib/base32.c (base32_encode, base32_encode_alloc, get_8, decode_8) (base32_decode_ctx, base32_decode_alloc_ctx): * lib/base32.h (struct base32_decode_context): * lib/base64.c (base64_encode_fast, base64_encode) (base64_encode_alloc, get_4, decode_4, base64_decode_ctx) (base64_decode_alloc_ctx): * lib/base64.h (struct base64_decode_context): * tests/test-base32.c (main): * tests/test-base64.c (main): Prefer signed to unsigned integers. * lib/base32.c (base32_encode_alloc): * lib/base64.c (base64_encode_alloc): Use simpler and more-direct check for overflow, removing a TODO. * lib/base32.h, lib/base64.h: Include idx.h instead of stddef.h. * modules/base32, modules/base64 (Depends-on): Add ialloc, verify.
* base32: new moduleGijs van Tulder2011-09-261-0/+26
* modules/base32: New module. * lib/base32.c: New file. * lib/base32.h: Likewise. * m4/base32.m4: Likewise. * modules/base32-tests: New test. * tests/test-base32.c: Likewise. * MODULES.html.sh (Misc): Mention it. Signed-off-by: Eric Blake <eblake@redhat.com>