Amos Jeffries squid3@treenet.co.nz writes:
The attached patch implements a proposed API/ABI extension adding support for RFC 4648 section 5 "Base 64 Encoding with URL and Filename Safe Alphabet"
Committed now, with some edits. Thanks!
I also added a
struct nettle_armor nettle_base64_url;
Looking at the base64_{en,de}code_ctx, maybe one could micro-optimize them while at it, like changing
struct base64_decode_ctx { unsigned word; unsigned bits; unsigned padding; const signed char *table; };
(typically 16 bytes on 32-bit machines, 24 (incl. alignment padding) on 64-bit machines) to
struct base64_decode_ctx { const signed char *table; unsigned short word; unsigned char bits; unsigned char padding; };
which would reduce the size to 8 and 16 bytes, respectively. At least, I think it's prettier to put the large pointer first in the struct.
Regards, /Niels