Here you can find the source of multiplyP8(int[] x)
static void multiplyP8(int[] x)
//package com.java2s; //License from project: Open Source License public class Main { static void multiplyP8(int[] x) { // for (int i = 8; i != 0; --i) // { // multiplyP(x); // } int lsw = x[3]; shiftRightN(x, 8);// ww w.ja v a 2 s .co m for (int i = 7; i >= 0; --i) { if ((lsw & (1 << i)) != 0) { x[0] ^= (0xe1000000 >>> (7 - i)); } } } static void multiplyP8(int[] x, int[] output) { int lsw = x[3]; shiftRightN(x, 8, output); for (int i = 7; i >= 0; --i) { if ((lsw & (1 << i)) != 0) { output[0] ^= (0xe1000000 >>> (7 - i)); } } } static void shiftRightN(int[] block, int n) { int i = 0; int bits = 0; for (;;) { int b = block[i]; block[i] = (b >>> n) | bits; if (++i == 4) { break; } bits = b << (32 - n); } } static void shiftRightN(int[] block, int n, int[] output) { int i = 0; int bits = 0; for (;;) { int b = block[i]; output[i] = (b >>> n) | bits; if (++i == 4) { break; } bits = b << (32 - n); } } }