Lines Matching +defs:base64 +defs:c
1 /* $NetBSD: base64.c,v 1.9 2025/01/26 16:25:36 christos Exp $ */
20 #include <isc/base64.h>
35 * These static functions are also present in lib/dns/rdata.c. I'm not
44 static const char base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw"
60 buf[0] = base64[(source->base[0] >> 2) & 0x3f];
61 buf[1] = base64[((source->base[0] << 4) & 0x30) |
63 buf[2] = base64[((source->base[1] << 2) & 0x3c) |
65 buf[3] = base64[source->base[2] & 0x3f];
77 buf[0] = base64[(source->base[0] >> 2) & 0x3f];
78 buf[1] = base64[((source->base[0] << 4) & 0x30) |
80 buf[2] = base64[((source->base[1] << 2) & 0x3c)];
85 buf[0] = base64[(source->base[0] >> 2) & 0x3f];
86 buf[1] = base64[((source->base[0] << 4) & 0x30)];
95 * State of a base64 decoding process in progress.
100 int digits; /*%< Number of buffered base64 digits */
114 base64_decode_char(base64_decode_ctx_t *ctx, int c) {
120 if ((s = strchr(base64, c)) == NULL) {
123 ctx->val[ctx->digits++] = (int)(s - base64);
231 int c = *cstr++;
232 if (c == '\0') {
235 if (c == ' ' || c == '\t' || c == '\n' || c == '\r') {
238 RETERR(base64_decode_char(&ctx, c));