private byte[] doubleLu(byte[] in) { byte[] ret = new byte[in.length]; int carry = shiftLeft(in, ret); /* * NOTE: This construction is an attempt at a constant-time implementation. */ int mask = (-carry) & 0xff; ret[in.length - 3] ^= poly[1] & mask; ret[in.length - 2] ^= poly[2] & mask; ret[in.length - 1] ^= poly[3] & mask; return ret; }