static int shiftLeft(byte[] block, byte[] output) {
		int i = block.length;
		int bit = 0;
		while (--i >= 0) {
			int b = block[i] & 0xff;
			output[i] = (byte) ((b << 1) | bit);
			bit = (b >>> 7) & 1;
		}
		return bit;
	}
static int shiftLeft ( byte [ ] block , byte [ ] output ) { int i = block . length ; int bit = 0 ; while ( -- i >= 0 ) { int b = block [ i ] & 0xff ; output [ i ] = ( byte ) ( ( b << 1 ) | bit ) ; bit = ( b > > > 7 ) & 1 ; } return bit ; }
Code taken from {@link org.bouncycastle.crypto.macs.CMac}