Examples of shiftLeft()


Examples of java.math.BigInteger.shiftLeft()

                if (k.testBit(j))
                {
                    Qh = Ql.multiply(Q).mod(p);
                    Uh = Uh.multiply(Vh).mod(p);
                    Vl = Vh.multiply(Vl).subtract(P.multiply(Ql)).mod(p);
                    Vh = Vh.multiply(Vh).subtract(Qh.shiftLeft(1)).mod(p);
                }
                else
                {
                    Qh = Ql;
                    Uh = Uh.multiply(Vl).subtract(Ql).mod(p);
View Full Code Here

Examples of java.math.BigInteger.shiftLeft()

            {
                if (bigValue == null)
                {
                    bigValue = BigInteger.valueOf(value);
                }
                bigValue = bigValue.shiftLeft(7);
                bigValue = bigValue.or(BigInteger.valueOf(b & 0x7f));
                if ((b & 0x80) == 0)
                {
                    objId.append('.');
                    objId.append(bigValue);
View Full Code Here

Examples of java.math.BigInteger.shiftLeft()

        while(!((r0.equals(ECConstants.ZERO)) && (r1.equals(ECConstants.ZERO))))
        {
            // If r0 is odd
            if (r0.testBit(0))
            {
                u[i] = (byte) ECConstants.TWO.subtract((r0.subtract(r1.shiftLeft(1))).mod(ECConstants.FOUR)).intValue();

                // r0 = r0 - u[i]
                if (u[i] == 1)
                {
                    r0 = r0.clearBit(0);
View Full Code Here

Examples of java.math.BigInteger.shiftLeft()

  {
    harness.checkPoint ("shift");
    BigInteger x =
      new BigInteger ("-50123044517898350982301255831878893568", 10);
    harness.check (x.shiftRight(64).toString(), "-2717175687894652269");
    harness.check (x.shiftLeft(-64).toString(), "-2717175687894652269");
    harness.check (x.shiftRight(1).toString(),
      "-25061522258949175491150627915939446784");
    harness.check (x.shiftLeft(1).toString(),
      "-100246089035796701964602511663757787136");
View Full Code Here

Examples of java.math.BigInteger.shiftLeft()

      new BigInteger ("-50123044517898350982301255831878893568", 10);
    harness.check (x.shiftRight(64).toString(), "-2717175687894652269");
    harness.check (x.shiftLeft(-64).toString(), "-2717175687894652269");
    harness.check (x.shiftRight(1).toString(),
      "-25061522258949175491150627915939446784");
    harness.check (x.shiftLeft(1).toString(),
      "-100246089035796701964602511663757787136");

    harness.check (x.shiftRight(0).toString(), x.toString());
    harness.check (x.shiftLeft(0).toString(), x.toString());
View Full Code Here

Examples of java.math.BigInteger.shiftLeft()

      "-25061522258949175491150627915939446784");
    harness.check (x.shiftLeft(1).toString(),
      "-100246089035796701964602511663757787136");

    harness.check (x.shiftRight(0).toString(), x.toString());
    harness.check (x.shiftLeft(0).toString(), x.toString());

    x = new BigInteger ("50123044517898350982301255831878893568", 10);
    harness.check (x.shiftRight(64).toString(), "2717175687894652268");
    harness.check (x.shiftLeft(-64).toString(), "2717175687894652268");
    harness.check (x.shiftRight(1).toString(),
View Full Code Here

Examples of java.math.BigInteger.shiftLeft()

    harness.check (x.shiftRight(0).toString(), x.toString());
    harness.check (x.shiftLeft(0).toString(), x.toString());

    x = new BigInteger ("50123044517898350982301255831878893568", 10);
    harness.check (x.shiftRight(64).toString(), "2717175687894652268");
    harness.check (x.shiftLeft(-64).toString(), "2717175687894652268");
    harness.check (x.shiftRight(1).toString(),
      "25061522258949175491150627915939446784");
    harness.check (x.shiftLeft(1).toString(),
      "100246089035796701964602511663757787136");
  }
View Full Code Here

Examples of java.math.BigInteger.shiftLeft()

    x = new BigInteger ("50123044517898350982301255831878893568", 10);
    harness.check (x.shiftRight(64).toString(), "2717175687894652268");
    harness.check (x.shiftLeft(-64).toString(), "2717175687894652268");
    harness.check (x.shiftRight(1).toString(),
      "25061522258949175491150627915939446784");
    harness.check (x.shiftLeft(1).toString(),
      "100246089035796701964602511663757787136");
  }
}
View Full Code Here

Examples of java.math.BigInteger.shiftLeft()

  }

  public BigInteger getBigInteger() {
    BigInteger result = BigInteger.ZERO;
    for (int i = this.size - 1; i >= 0; i--) {
      result = result.shiftLeft(1);
      if (this.get(i)) {
        result = result.add(BigInteger.ONE);
      }
    }
    return result;
View Full Code Here

Examples of java.math.BigInteger.shiftLeft()

                        /* test whether a^(d*2^r) = -1 (mod n), 0<=r<s
                        */
                        for(int r=0; r < s ; r++)
                        {
                                if ( a.modPow(d.shiftLeft(r),n).compareTo(q) == 0 )
                                        return true ;
                        }
                        return false ;
                }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.