Here you can find the source of shiftLeft(byte[] block, byte[] output)
private static int shiftLeft(byte[] block, byte[] output)
//package com.java2s; /******************************************************************************* * Copyright (c) 2014 Sebastian Stenzel/*from w w w. jav a 2s . co m*/ * This file is licensed under the terms of the MIT license. * See the LICENSE.txt file for more info. * * Contributors: * Sebastian Stenzel - initial API and implementation ******************************************************************************/ public class Main { /** * Code taken from {@link org.bouncycastle.crypto.macs.CMac} */ private 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; } }