Package java.math

Examples of java.math.BigInteger.remainder()


    }

    private BigInteger generateR(BigInteger p, BigInteger q, BigInteger g,
                         BigInteger k) {
        BigInteger temp = g.modPow(k, p);
        return temp.remainder(q);
   }

    private BigInteger generateS(BigInteger x, BigInteger q,
            BigInteger r, BigInteger k) throws SignatureException {
View Full Code Here


        BigInteger k1 = k.modInverse(q);

        BigInteger s = x.multiply(r);
        s = temp.add(s);
        s = k1.multiply(s);
        return s.remainder(q);
    }

    private BigInteger generateW(BigInteger p, BigInteger q,
                         BigInteger g, BigInteger s) {
        return s.modInverse(q);
View Full Code Here

        BigInteger t1 = g.modPow(u1,p);
        BigInteger t2 = y.modPow(u2,p);
        BigInteger t3 = t1.multiply(t2);
        BigInteger t5 = t3.remainder(p);
        return t5.remainder(q);
    }

    /*
     * Please read bug report 4044247 for an alternative, faster,
     * NON-FIPS approved method to generate K
View Full Code Here

    int max = 0;
    for (int i = 0; i < word.length(); i++) {
      String test = rack + word.charAt(i);
      BigInteger hash = getHash(test);
      for (Entry<BigInteger, String> e : _hashes.entrySet()) {
        if (hash.remainder(e.getKey()).equals(BigInteger.ZERO)) {
          String w = e.getValue();
          int points = getPoints(w);
          if (points == max) {
            if (w.compareTo(s) < 0) {
              s = w;
View Full Code Here

     */
    public void setFractionalSecond(BigDecimal fractional) {
        calendarValue = null;
        second = fractional.intValue();
        BigInteger micros = fractional.movePointRight(6).toBigInteger();
        micros = micros.remainder(BigInteger.valueOf(1000000));
        microsecond = micros.intValue();
    }

    /**
     * <p>Return high order component for XML Schema 1.0 dateTime datatype field for
View Full Code Here

  public synchronized static boolean has(int number, int denominator) {
    boolean returnValue = true;
    BigInteger foo = BigInteger.valueOf(number);
    if (BigInteger.valueOf(0L).compareTo(
        foo.remainder(BigInteger.valueOf(denominator))) == 0) {
      returnValue = false;
    }
    return returnValue;
  }
View Full Code Here

              BigInteger biRemainder,
              int nCertainty) {
  Random rand=randomGenerator();
  for( ; ; ) {
      BigInteger biPrime=new BigInteger(nBitLength,nCertainty,rand);
      if(biPrime.remainder(biDivisor).compareTo(biRemainder) == 0
         && biPrime.shiftRight(1).isProbablePrime(nCertainty)) {
    System.out.println("");
    return biPrime;
      }
      System.out.print(".");
View Full Code Here

      }
      else
      {
        // Modulo (%)
        BigInteger tmpL = (BigInteger)l,  tmpR = (BigInteger)r;
        value (tmpL.remainder (tmpR));
        //daz        value (tmpL.mod (tmpR));  Requires positive modulus; not required by IDL.
        //daz        value (new Long (l.longValue () % r.longValue ()));
      }
    }
    catch (ClassCastException e)
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.