FileDocCategorySizeDatePackage
ECFieldFp.javaAPI DocAndroid 1.5 API3102Wed May 06 22:41:06 BST 2009java.security.spec

ECFieldFp

public class ECFieldFp extends Object implements ECField
The parameters specifying a prime finite field of an elliptic curve.
since
Android 1.0

Fields Summary
private final BigInteger
p
Constructors Summary
public ECFieldFp(BigInteger p)
Creates a new prime finite field of an elliptic curve with the specified prime {@code p}.

param
p the prime value {@code p}.
throws
IllegalArgumentException if {@code p <= zero}.
since
Android 1.0

        this.p = p;

        if (this.p == null) {
            throw new NullPointerException(Messages.getString("security.83", "p")); //$NON-NLS-1$ //$NON-NLS-2$
        }
        if (this.p.signum() != 1) {
            throw new IllegalArgumentException(Messages.getString("security.86", "p")); //$NON-NLS-1$ //$NON-NLS-2$
        }
    
Methods Summary
public booleanequals(java.lang.Object obj)
Returns whether the specified object is equal to this finite field.

param
obj the object to compare to this finite field.
return
{@code true} if the specified object is equal to this finite field, otherwise {@code false}.
since
Android 1.0

        // object equals itself
        if (this == obj) {
            return true;
        }
        if (obj instanceof ECFieldFp) {
            return (this.p.equals(((ECFieldFp)obj).p));
        }
        return false;
    
public intgetFieldSize()
Returns the size of the finite field (in bits).

return
the size of the finite field (in bits).
since
Android 1.0

        return p.bitLength();
    
public java.math.BigIntegergetP()
Returns the prime value {@code p} for this finite field.

return
the prime value {@code p} for this finite field.
since
Android 1.0

        return p;
    
public inthashCode()
Returns the hashcode value for this finite field.

return
the hashcode value for this finite field.
since
Android 1.0

        return p.hashCode();