Examples of ECFieldFp


Examples of java.security.spec.ECFieldFp

     * the same object)
     */
    public final void testGetCurve() {
        // 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

Examples of java.security.spec.ECFieldFp

     * the same object)
     */
    public final void testGetGenerator() {
        // 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

Examples of java.security.spec.ECFieldFp

     * 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

Examples of java.security.spec.ECFieldFp

     * Expected: must pass without any exceptions
     */
    public final void testECPrivateKeySpec01() {
        // Valid (see note below) parameters set
        EllipticCurve c =
            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
                              BigInteger.ZERO,
                              BigInteger.valueOf(4L));
        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
        new ECPrivateKeySpec(BigInteger.ZERO,
                new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
View Full Code Here

Examples of java.security.spec.ECFieldFp

     * Expected: must throw <code>NullPointerException</code>
     */
    public final void testECPrivateKeySpec02() {
        // Valid (see note below) parameters set
        EllipticCurve c =
            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
                              BigInteger.ZERO,
                              BigInteger.valueOf(4L));
        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));

        // Test case 1: s is null
View Full Code Here

Examples of java.security.spec.ECFieldFp

     * the same object)
     */
    public final void testGetParams() {
        // Valid (see note below) parameters set
        EllipticCurve c =
            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
                              BigInteger.ZERO,
                              BigInteger.valueOf(4L));
        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
        ECParameterSpec params =
            new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);
View Full Code Here

Examples of java.security.spec.ECFieldFp

     * the same object)
     */
    public final void testGetS() {
        // Valid (see note below) parameters set
        EllipticCurve c =
            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
                              BigInteger.ZERO,
                              BigInteger.valueOf(4L));
        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
        ECParameterSpec params =
            new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10);
View Full Code Here

Examples of java.security.spec.ECFieldFp

     * Expected: all objects in this test must be NOT equal
     */
    public final void testEqualsObject02() {
        // test case 1: must not be equal to null
        EllipticCurve c2=null, c1 =
            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
                    BigInteger.ONE,
                    BigInteger.valueOf(19L));
        assertFalse(c1.equals(c2));

        // test case 2: not equal objects - field
        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
                BigInteger.ONE,
                BigInteger.valueOf(19L));
        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(31L)),
                BigInteger.valueOf(1L),
                BigInteger.valueOf(19L));
        assertFalse(c1.equals(c2) || c2.equals(c1));

        // test case 3: not equal objects - a
        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
                BigInteger.ONE,
                BigInteger.valueOf(19L));
        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
                BigInteger.ZERO,
                BigInteger.valueOf(19L));
        assertFalse(c1.equals(c2) || c2.equals(c1));

        // test case 4: not equal objects - b
        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
                BigInteger.ONE,
                BigInteger.valueOf(19L));
        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
                BigInteger.ONE,
                BigInteger.valueOf(17L));
        assertFalse(c1.equals(c2) || c2.equals(c1));

        // test case 5: not equal objects - both seed not null
        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
                BigInteger.ONE,
                BigInteger.valueOf(19L),
                new byte[24]);
        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
                BigInteger.valueOf(1L),
                BigInteger.valueOf(19L),
                new byte[25]);
        assertFalse(c1.equals(c2) || c2.equals(c1));

        // test case 6: not equal objects - one seed is null
        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
                BigInteger.ONE,
                BigInteger.valueOf(19L),
                null);
        c2 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
                BigInteger.valueOf(1L),
                BigInteger.valueOf(19L),
                new byte[24]);
        assertFalse(c1.equals(c2) || c2.equals(c1));

        // test case 7: not equal objects - field class
        c1 = new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
                BigInteger.ONE,
                BigInteger.valueOf(19L),
                new byte[24]);
        c2 = new EllipticCurve(new ECFieldF2m(5),
                BigInteger.ONE,
View Full Code Here

Examples of java.security.spec.ECFieldFp

     * Expected: must pass without any exceptions
     */
    public final void testECPublicKeySpec01() {
        // Valid (see note below) parameters set
        EllipticCurve c =
            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
                              BigInteger.ZERO,
                              BigInteger.valueOf(4L));
        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));
        new ECPublicKeySpec(g,
                new ECParameterSpec(c, g, BigInteger.valueOf(5L), 10));
View Full Code Here

Examples of java.security.spec.ECFieldFp

     * Expected: must throw <code>NullPointerException</code>
     */
    public final void testECPublicKeySpec02() {
        // Valid (see note below) parameters set
        EllipticCurve c =
            new EllipticCurve(new ECFieldFp(BigInteger.valueOf(5L)),
                              BigInteger.ZERO,
                              BigInteger.valueOf(4L));
        ECPoint g = new ECPoint(BigInteger.ZERO, BigInteger.valueOf(2L));

        // Test case 1: w is null
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.