- BLKC_STORE(PRE, ctx->b, t); \
- off = 0; \
- \
- /* --- Tidying up the tail end --- */ \
- \
- if (sz) { \
- small: \
- do { \
- y = s ? *s++ : 0; \
- ctx->b[off] ^= y; \
- if (d) *d++ = ctx->b[off]; \
- off++; sz--; \
- } while (sz); \
+ /* If the buffer is all used, then reset it ready for next time. */ \
+ ctx->off -= plan.from_rsvr; \
+ \
+ /* Handle multiple whole blocks. */ \
+ if (!d) { \
+ if (!s) while (plan.from_input) { \
+ pre##_eblk(&ctx->ctx, t, t); \
+ plan.from_input -= PRE##_BLKSZ; \
+ } else while (plan.from_input) { \
+ pre##_eblk(&ctx->ctx, t, t); \
+ BLKC_XLOAD(PRE, t, s); s += PRE##_BLKSZ; \
+ plan.from_input -= PRE##_BLKSZ; \
+ } \
+ } else { \
+ if (!s) while (plan.from_input) { \
+ pre##_eblk(&ctx->ctx, t, t); \
+ BLKC_STORE(PRE, d, t); d += PRE##_BLKSZ; \
+ plan.from_input -= PRE##_BLKSZ; \
+ } else while (plan.from_input) { \
+ pre##_eblk(&ctx->ctx, t, t); \
+ BLKC_XLOAD(PRE, t, s); s += PRE##_BLKSZ; \
+ BLKC_STORE(PRE, d, t); d += PRE##_BLKSZ; \
+ plan.from_input -= PRE##_BLKSZ; \
+ } \