Lines Matching full:st
61 static void base64_outch(struct jwt_builder *st, char ch) in base64_outch() argument
63 if (st->overflowed) { in base64_outch()
67 if (st->len < 2) { in base64_outch()
68 st->overflowed = true; in base64_outch()
72 *st->buf++ = ch; in base64_outch()
73 st->len--; in base64_outch()
74 *st->buf = 0; in base64_outch()
82 static void base64_flush(struct jwt_builder *st) in base64_flush() argument
84 if (st->pending < 1) { in base64_flush()
88 base64_outch(st, base64_char(st->wip[0] >> 2)); in base64_flush()
89 base64_outch(st, base64_char(((st->wip[0] & 0x03) << 4) | in base64_flush()
90 (st->wip[1] >> 4))); in base64_flush()
92 if (st->pending >= 2) { in base64_flush()
93 base64_outch(st, base64_char(((st->wip[1] & 0x0f) << 2) | in base64_flush()
94 (st->wip[2] >> 6))); in base64_flush()
96 if (st->pending >= 3) { in base64_flush()
97 base64_outch(st, base64_char(st->wip[2] & 0x3f)); in base64_flush()
100 st->pending = 0; in base64_flush()
101 memset(st->wip, 0, 3); in base64_flush()
104 static void base64_addbyte(struct jwt_builder *st, uint8_t byte) in base64_addbyte() argument
106 st->wip[st->pending++] = byte; in base64_addbyte()
107 if (st->pending == 3) { in base64_addbyte()
108 base64_flush(st); in base64_addbyte()
115 struct jwt_builder *st = data; in base64_append_bytes() local
118 base64_addbyte(st, *bytes++); in base64_append_bytes()