Here you can find the source of multiplyP(int[] x)
static void multiplyP(int[] x)
//package com.java2s; //License from project: Open Source License public class Main { static void multiplyP(int[] x) { boolean lsb = (x[3] & 1) != 0; shiftRight(x);//from ww w.j a v a 2 s . c o m if (lsb) { // R = new int[]{ 0xe1000000, 0, 0, 0 }; // xor(v, R); x[0] ^= 0xe1000000; } } static void multiplyP(int[] x, int[] output) { boolean lsb = (x[3] & 1) != 0; shiftRight(x, output); if (lsb) { output[0] ^= 0xe1000000; } } 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; } 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; } } }