de.flexiprovider.common.math.ellipticcurves
Class EllipticCurve

java.lang.Object
  |
  +--de.flexiprovider.common.math.ellipticcurves.EllipticCurve
Direct Known Subclasses:
EllipticCurveGF2n, EllipticCurveGFP

public abstract class EllipticCurve
extends java.lang.Object

This class is the top-interface for elliptic curves over finite fields. Implemented are those over prime fields GF(p) (EllipticCurveGFP) as well as over characteristic 2 fields GF(2n)) (EllipticCurveGF2n).

This class stores the size of the underlying field as a FlexiBigInt mQ = p or mQ = 2n. The curve parameters a and b are stored as instances of GFElement.

Author:
Birgit Henhapl, Martin Döring
See Also:
EllipticCurveGFP, EllipticCurveGF2n, GFElement

Field Summary
protected  GFElement mA
          curve parameter a
protected  GFElement mB
          curve parameter b
protected  FlexiBigInt mQ
          size of the underlying field
 
Constructor Summary
protected EllipticCurve(GFElement a, GFElement b, FlexiBigInt q)
          Construct an elliptic curve E with the specified parameters.
 
Method Summary
 boolean equals(java.lang.Object other)
          Compare this curve with another object.
 GFElement getA()
           
 GFElement getB()
           
 FlexiBigInt getQ()
          Returns the size of underlying field p.
 int hashCode()
           
abstract  java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mQ

protected FlexiBigInt mQ
size of the underlying field

mA

protected GFElement mA
curve parameter a

mB

protected GFElement mB
curve parameter b
Constructor Detail

EllipticCurve

protected EllipticCurve(GFElement a,
                        GFElement b,
                        FlexiBigInt q)
Construct an elliptic curve E with the specified parameters.
Parameters:
a - curve parameter a
b - curve parameter b
q - size of the underlying field
See Also:
GFElement
Method Detail

getQ

public FlexiBigInt getQ()
Returns the size of underlying field p.
Returns:
characteristic of underlying field p

getA

public GFElement getA()
Returns:
a copy of the elliptic curve parameter a

getB

public GFElement getB()
Returns:
a copy of the elliptic curve parameter b

equals

public boolean equals(java.lang.Object other)
Compare this curve with another object.
Overrides:
equals in class java.lang.Object
Parameters:
other - the other object
Returns:
the result of the comparison

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
the hash code of this curve

toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a human readable form of this elliptic curve