Here you can find the source of shiftRight(byte[] block)
static void shiftRight(byte[] block)
//package com.java2s; //License from project: Open Source License public class Main { static void shiftRight(byte[] block) { int i = 0; int bit = 0; for (;;) { int b = block[i] & 0xff; block[i] = (byte) ((b >>> 1) | bit); if (++i == 16) { break; }/* ww w. j ava 2 s .c o m*/ bit = (b & 1) << 7; } } static void shiftRight(byte[] block, byte[] output) { int i = 0; int bit = 0; for (;;) { int b = block[i] & 0xff; output[i] = (byte) ((b >>> 1) | bit); if (++i == 16) { break; } bit = (b & 1) << 7; } } static void shiftRight(int[] block) { int i = 0; int bit = 0; for (;;) { int b = block[i]; block[i] = (b >>> 1) | bit; if (++i == 4) { break; } bit = b << 31; } } static void shiftRight(int[] block, int[] output) { int i = 0; int bit = 0; for (;;) { int b = block[i]; output[i] = (b >>> 1) | bit; if (++i == 4) { break; } bit = b << 31; } } }