Examples of BigInteger


Examples of cc.redberry.core.transformations.factor.jasfactor.edu.jas.arith.BigInteger

    static Tensor poly2Tensor(GenPolynomial<BigInteger> poly, Var[] varsArray) {
        if (poly.length() == 0)
            return Complex.ZERO;
        List<Tensor> temp = new ArrayList<>(), sum = new ArrayList<>(poly.length());
        long lExp;
        BigInteger coefficient;
        ExpVector exp;
        for (Monomial<BigInteger> monomial : poly) {
            coefficient = monomial.coefficient();
            exp = monomial.exponent();
            temp.clear();

            temp.add(new Complex(new Rational(coefficient.getVal())));
            for (int i = 0; i < exp.length(); ++i)
                if ((lExp = exp.getVal(i)) != 0)
                    temp.add(Tensors.pow(varsArray[i].simpleTensor, new Complex(lExp)));

            sum.add(Tensors.multiply(temp.toArray(new Tensor[temp.size()])));
View Full Code Here

Examples of com.zaranux.client.crypto.util.BigInteger

    /**
     * RSA public key ops and non-CRT private key ops. Simple modPow().
     */
    private static byte[] crypt(byte[] msg, BigInteger n, BigInteger exp)
      throws BadPaddingException {
        BigInteger m = parseMsg(msg, n);
        BigInteger c = m.modPow(exp, n);
        return toByteArray(c, getByteLength(n));
    }
View Full Code Here

Examples of java.math.BigInteger

          random = new Random(2010);
        }
        random.nextBytes(randomBytes);
        randomBytes[6&= 0x0f/* clear version        */
        randomBytes[6|= 0x40/* set to version 4     */
        long msb = new BigInteger(randomBytes).longValue();
        random.nextBytes(randomBytes);
        randomBytes[0&= 0x3f/* clear variant        */
        randomBytes[0|= 0x80/* set to IETF variant  */
        long lsb = new BigInteger(randomBytes).longValue();
        record.setUUID("mmuid:"+new UUID(msb, lsb)); //$NON-NLS-1$
  }
View Full Code Here

Examples of java.math.BigInteger

            if(data.equals("N/A")) { //$NON-NLS-1$
                row.add(null);
            } else if(i==1 || i==4 || i== 5 || i==6 || i==7) {
                row.add(Double.valueOf(data));
            } else if(i==8) {
                row.add(new BigInteger(data));
            } else if(i==2) {
                if(!data.equals("0")){ //$NON-NLS-1$
                    try {
                        Date date = DATE_FORMAT.parse(data);
                        row.add(new java.sql.Date(date.getTime()));
View Full Code Here

Examples of java.math.BigInteger

  }


  public static String getEtag(byte[] bytes) {
    byte[] digest = md.digest(bytes);
    BigInteger number = new BigInteger(1, digest);
    return '0' + number.toString(16)// prepend a '0' to get a proper MD5 hash
  }
View Full Code Here

Examples of java.math.BigInteger

                    break;
                case DOUBLE:
                    this.sum = new Double(0);
                    break;
                case BIG_INTEGER:
                    this.sum = new BigInteger(String.valueOf(0));
                    break;
                case BIG_DECIMAL:
                    this.sum = new BigDecimal(0);
                    break;
            }
        }
           
        switch(this.accumulatorType) {       
            case LONG:
                this.sum = new Long(((Long)this.sum).longValue() + ((Number)input).longValue());
                break;
            case DOUBLE:
                this.sum = new Double(((Double)this.sum).doubleValue() + ((Number)input).doubleValue());
                break;
            case BIG_INTEGER:
                this.sum = ((BigInteger)this.sum).add( (BigInteger) input );
                break;
            case BIG_DECIMAL:
                if (input instanceof BigInteger) {
                    BigInteger bigIntegerInput = (BigInteger) input;
                    this.sum = ((BigDecimal)this.sum).add( new BigDecimal(bigIntegerInput) );
                } else {
                    this.sum = ((BigDecimal)this.sum).add( (BigDecimal) input );
                }
                break;   
View Full Code Here

Examples of java.math.BigInteger

      KeyFactory myKeyFac=KeyFactory.getInstance("DH");
      DHPublicKeySpec keySpec=new DHPublicKeySpec(f, p, g);
      PublicKey yourPubKey=myKeyFac.generatePublic(keySpec);
      myKeyAgree.doPhase(yourPubKey, true);
      byte[] mySharedSecret=myKeyAgree.generateSecret();
      K=new BigInteger(mySharedSecret);
      K_array=K.toByteArray();

//System.err.println("K.signum(): "+K.signum()+
//       " "+Integer.toHexString(mySharedSecret[0]&0xff)+
//       " "+Integer.toHexString(K_array[0]&0xff));
View Full Code Here

Examples of java.math.BigInteger

      K_array=mySharedSecret;
    }
    return K_array;
  }
  public void setP(byte[] p){ setP(new BigInteger(p)); }
View Full Code Here

Examples of java.math.BigInteger

      K_array=mySharedSecret;
    }
    return K_array;
  }
  public void setP(byte[] p){ setP(new BigInteger(p)); }
  public void setG(byte[] g){ setG(new BigInteger(g)); }
View Full Code Here

Examples of java.math.BigInteger

    }
    return K_array;
  }
  public void setP(byte[] p){ setP(new BigInteger(p)); }
  public void setG(byte[] g){ setG(new BigInteger(g)); }
  public void setF(byte[] f){ setF(new BigInteger(f)); }
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.