Java Array Multiply multiplyP(int[] x)

Here you can find the source of multiplyP(int[] x)

Description

multiply P

License

Apache License

Declaration

static void multiplyP(int[] x) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    static void multiplyP(int[] x) {
        boolean lsb = (x[3] & 1) != 0;
        shiftRight(x);//w w  w.  j a v  a2  s .co m
        if (lsb) {
            // R = new int[]{ 0xe1000000, 0, 0, 0 };
            //            xor(v, R);
            x[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(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;
        }
    }
}

Related

  1. multiplyInPlace(double[] img, double val)
  2. multiplyInto(double[] out, double[] a, double[] b)
  3. multiplyP(int[] x)
  4. multiplyP(int[] x)
  5. multiplyP(int[] x)
  6. multiplyP8(int[] x)
  7. multiplyP8(int[] x)
  8. MultiplyPointSimilarityInhomogenous(double[] xp, int idx, double[] H, double[] x, int idx2)
  9. multiplyRange(double[] accumulator, int offset, double[] modulator)