Package java.security.spec

Examples of java.security.spec.ECFieldFp


     *
     * Assertion: must return the same value if invoked
     * repeatedly on the same object.
     */
    public final void testHashCode01() {
        ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L));
        int hc = f.hashCode();
        assertTrue(hc == f.hashCode() &&
                   hc == f.hashCode() &&
                   hc == f.hashCode() &&
                   hc == f.hashCode() &&
                   hc == f.hashCode() &&
                   hc == f.hashCode() &&
                   hc == f.hashCode() &&
                   hc == f.hashCode());
    }
View Full Code Here


     *
     * Assertion: must return the same value if invoked
     * on equal (according to the <code>equals(Object)</code> method) objects.
     */
    public final void testHashCode02() {
        assertTrue(new ECFieldFp(BigInteger.valueOf(23L)).hashCode() ==
                   new ECFieldFp(BigInteger.valueOf(23L)).hashCode());
    }
View Full Code Here

     * Test for <code>getFieldSize()()</code> method.<br>
     *
     * Assertion: returns field size in bits which is prime size
     */
    public final void testGetFieldSize() {
        assertEquals(5, new ECFieldFp(BigInteger.valueOf(23L)).getFieldSize());
    }
View Full Code Here

     *
     * Assertion: returns prime
     */
    public final void testGetP() {
        BigInteger p = BigInteger.valueOf(23L);
        assertTrue(p.equals(new ECFieldFp(p).getP()));
    }
View Full Code Here

     * Test #1 for <code>equals()</code> method.<br>
     *
     * Assertion: object equals to itself.
     */
    public final void testEqualsObject01() {
        ECFieldFp obj = new ECFieldFp(BigInteger.valueOf(23L));
        assertTrue(obj.equals(obj));
    }
View Full Code Here

     * Test #2 for <code>equals(Object obj)</code> method.<br>
     *
     * Assertion: returns false if <code>obj</code> is <code>null</code>
     */
    public final void testEqualsObject02() {
        assertFalse(new ECFieldFp(BigInteger.valueOf(23L)).equals(null));
    }
View Full Code Here

     *
     * Assertion: returns false if <code>obj</code>
     * is not instance of <code>ECFieldFp</code>
     */
    public final void testEqualsObject03() {
        assertFalse(new ECFieldFp(BigInteger.valueOf(23L)).equals(new Object()));
    }
View Full Code Here

     * Test #4 for <code>equals()</code> method.<br>
     *
     * Assertion: true if prime values match.
     */
    public final void testEqualsObject04() {
        assertTrue(new ECFieldFp(BigInteger.valueOf(23L)).equals(
                   new ECFieldFp(BigInteger.valueOf(23L))));
    }
View Full Code Here

    {
        // TODO: the Sun EC implementation doesn't currently handle the seed properly
        // so at the moment it's set to null. Should probably look at making this configurable
        if (curve instanceof ECCurve.Fp)
        {
            return new EllipticCurve(new ECFieldFp(((ECCurve.Fp)curve).getQ()), curve.getA().toBigInteger(), curve.getB().toBigInteger(), null);
        }
        else
        {
            ECCurve.F2m curveF2m = (ECCurve.F2m)curve;
            int ks[];
View Full Code Here

     * the same object)
     */
    public final void testGetOrder() {
        // Valid (see note below) parameters set
        EllipticCurve curve =
            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
                              BigInteger.ZERO,
                              BigInteger.valueOf(4L));
        ECPoint generator = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
        BigInteger order = BigInteger.valueOf(5L);
        int cofactor = 10;
View Full Code Here

TOP

Related Classes of java.security.spec.ECFieldFp

Copyright © 2018 www.massapicom. 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.