Code example for BigInteger

Methods: mod, subtract

0
 
            BigInteger e = k.getPublicExponent();
            if (e != null)   // can't do blinding without a public exponent
            { 
                BigInteger m = k.getModulus();
                BigInteger r = BigIntegers.createRandomInRange(ONE, m.subtract(ONE), random);
 
                BigInteger blindedInput = r.modPow(e, m).multiply(input).mod(m);
                BigInteger blindedResult = core.processBlock(blindedInput);
 
                BigInteger rInv = r.modInverse(m);
                result = blindedResult.multiply(rInv).mod(m);
            } 
            else 
            { 
                result = core.processBlock(input);
            } 
        } 
        else 
        { 
            result = core.processBlock(input);