Package org.bouncycastle.math.ec

Examples of org.bouncycastle.math.ec.ECFieldElement.toBigInteger()


        ECFieldElement t = fe;
        for (int i = 0; i < fe.getFieldSize() - 1; i++)
        {
            t = t.square().add(fe);
        }
        return t.toBigInteger();
    }

    /**
     * Solves a quadratic equation <code>z<sup>2</sup> + z = beta</code>(X9.62
     * D.1.6) The other solution is <code>z + 1</code>.
View Full Code Here


    }

    public BigInteger[] generateSignature(byte[] message)
    {
        ECFieldElement h = hash2FieldElement(key.getParameters().getCurve(), message);
        if (h.toBigInteger().signum() == 0)
        {
            h = key.getParameters().getCurve().fromBigInteger(ONE);
        }

        BigInteger e, r, s;
View Full Code Here

                do
                {
                    e = generateRandomInteger(key.getParameters().getN(), random);
                    Fe = key.getParameters().getG().multiply(e).getX();
                }
                while (Fe.toBigInteger().signum() == 0);

                y = h.multiply(Fe);
                r = fieldElement2Integer(key.getParameters().getN(), y);
            }
            while (r.signum() == 0);
View Full Code Here

        {
            return false;
        }

        ECFieldElement h = hash2FieldElement(key.getParameters().getCurve(), message);
        if (h.toBigInteger().signum() == 0)
        {
            h = key.getParameters().getCurve().fromBigInteger(ONE);
        }

        ECPoint R = ECAlgorithms.sumOfTwoMultiplies(key.getParameters().getG(), s, ((ECPublicKeyParameters)key).getQ(), r);
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.