Code example for BigInteger

Methods: compareTo, subtract

0
	       long seed = 125L;
	       prng = new Random (seed);
				  
  			//d is the sender private key 
               // Step 1 : Select random number d such that d <n 
			d = new BigInteger (192, prng);
                if (d.compareTo (n) > 0)
                    d = d.subtract (n);
        }	    
	    
    public ECPoint publicValue()
      	{ 
			//Q is the sender public key 
            // Step 2: calculate Q= d. G 
            Qs = G.multiply (d);
       		return (Qs);
       	} 
	    
		// calculation of K 
    public void secretValue(ECPoint Qk)
    	{