static void ctr_XOR(DRBG_CTR_CTX *cctx, const unsigned char *in, size_t inlen)
{
    size_t i, n;

    if (in == NULL || inlen == 0)
        return;

    /*
     * Any zero padding will have no effect on the result as we
     * are XORing. So just process however much input we have.
     */
    n = inlen < cctx->keylen ? inlen : cctx->keylen;
    for (i = 0; i < n; i++)
        cctx->K[i] ^= in[i];
    if (inlen <= cctx->keylen)
        return;

    n = inlen - cctx->keylen;
    if (n > 16) {
        /* Should never happen */
        n = 16;
    }
    for (i = 0; i < 16; i++)
        cctx->V[i] ^= in[i + cctx->keylen];
}