Package java.math

Examples of java.math.BigInteger.mod()


                ECPoint p = key.getParameters().getG().multiply(k);

                BigInteger x = p.getX().toBigInteger();

                r = x.mod(n);
            }
            while (r.equals(ECConstants.ZERO));

            BigInteger d = ((ECPrivateKeyParameters)key).getD();
View Full Code Here


                ECPoint p = key.getParameters().getG().multiply(k);

                // 5.3.3
                BigInteger x = p.getX().toBigInteger();

                r = x.mod(n);
            }
            while (r.equals(ZERO));

            BigInteger d = ((ECPrivateKeyParameters)key).getD();
View Full Code Here

                    hash(d, offset, output);

                    BigInteger Vj = new BigInteger(1, output);
                    if (j == n)
                    {
                        Vj = Vj.mod(ONE.shiftLeft(b));
                    }

                    W = W.add(Vj.shiftLeft(exp));
                }
View Full Code Here

        //
        for (;;)
        {
            p = new BigInteger(pbitlength, 1, param.getRandom());
           
            if (p.mod(e).equals(ONE))
            {
                continue;
            }
           
            if (!p.isProbablePrime(param.getCertainty()))
View Full Code Here

                //step 9
                BigInteger N = TWO.pow(t[m]-1).divide(p[m+1]).
                                   add((TWO.pow(t[m]-1).multiply(Ym)).
                                       divide(p[m+1].multiply(TWO.pow(16*rm))));

                if (N.mod(TWO).compareTo(ONE)==0)
                {
                    N = N.add(ONE);
                }

                int k = 0; //step 10
View Full Code Here

                //step 9
                BigInteger N = TWO.pow(t[m]-1).divide(p[m+1]).
                                   add((TWO.pow(t[m]-1).multiply(Ym)).
                                       divide(p[m+1].multiply(TWO.pow(32*rm))));

                if (N.mod(TWO).compareTo(ONE)==0)
                {
                    N = N.add(ONE);
                }

                int k = 0; //step 10
View Full Code Here

            //step 6
            BigInteger N = TWO.pow(tp-1).divide(q.multiply(Q)).
                               add((TWO.pow(tp-1).multiply(Y)).
                                   divide(q.multiply(Q).multiply(TWO.pow(1024))));

            if (N.mod(TWO).compareTo(ONE)==0)
            {
                N = N.add(ONE);
            }

            int k = 0; //step 7
View Full Code Here

            //step 6
            BigInteger N = TWO.pow(tp-1).divide(q.multiply(Q)).
                               add((TWO.pow(tp-1).multiply(Y)).
                                   divide(q.multiply(Q).multiply(TWO.pow(1024))));

            if (N.mod(TWO).compareTo(ONE)==0)
            {
                N = N.add(ONE);
            }

            int k = 0; //step 7
View Full Code Here

        BigInteger bR = (BigInteger)r;

        BigInteger ls  = bL.shiftLeft (bR.intValue ());

        if (type ().indexOf ("short") >= 0)
          ls = ls.mod (twoPow16);
        else if (type ().indexOf ("long") >= 0)
          ls = ls.mod (twoPow32);
        else if (type ().indexOf ("long long") >= 0)
          ls = ls.mod (twoPow64);
View Full Code Here

        BigInteger ls  = bL.shiftLeft (bR.intValue ());

        if (type ().indexOf ("short") >= 0)
          ls = ls.mod (twoPow16);
        else if (type ().indexOf ("long") >= 0)
          ls = ls.mod (twoPow32);
        else if (type ().indexOf ("long long") >= 0)
          ls = ls.mod (twoPow64);

        value (coerceToTarget (ls));
      }
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.