On Sun, Apr 5, 2020 at 7:57 PM Niels Möller nisse@lysator.liu.se wrote:
Sorry for the delay in review. This is a fairly large change, and I think it has to wait until after the Nettle-3.6 release. Maybe it could be split into smaller pieces, e.g, a separate patch to introduce blowfish-internal.h and move needed declaratinos there.
I'll split it up, and resubmit. No problem.
Only one comment for now:
--- a/base64-decode.c +++ b/base64-decode.c
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- if ((uint8_t) src > 0x7f)
- return -1;
- data = ctx->table[(uint8_t) src];
I'm not entirely sure halving the table size is a good tradeoff. If we want to do it, that should be a separete change.
You mean because it will cost an extra clockcycle on decode per character? That will only be relevant for very large sequences of base64 characters. And the sequences are that large, the speed to decode becomes RAM-access bound; in which case there will be plenty of spare CPU cycles. This essentially makes the extra "if" cost-free.