/* Return x^(n * 2^k) modulo p(x). Requires that x2n_table has been initialized.  */
z_crc_t x2nmodp(z_off64_t n, unsigned k)
/* Return x^(n * 2^k) modulo p(x). Requires that x2n_table has been initialized.  */
z_crc_t x2nmodp(z_off64_t n, unsigned k)
{
    z_crc_t p;
    p = (z_crc_t)1 << 31;
    while (n) {
        if (n & 1)
            p = multmodp(x2n_table[k & 31], p);
        n >>= 1;
        k++;
    }
    return p;
}