IAIK ECC
version 2.18

iaik.security.ecc.math.ecgroup
Class ECGroupFactory

java.lang.Object
  extended byiaik.security.ecc.math.ecgroup.ECGroupFactory

public abstract class ECGroupFactory
extends java.lang.Object

Abstract base class for all ecgroup factories. Subclasses provide factory methods for concrete implementations.


Constructor Summary
protected ECGroupFactory()
          Implemented as singleton.
 
Method Summary
abstract  EllipticCurve getCurve(FieldElement a, FieldElement b, java.math.BigInteger curveOrder, int coordinateType)
          ATTENTION: Make sure that the curve parameter specify a valid elliptic curve and are elements of the same field.
abstract  EllipticCurve getDefault(FieldElement a, FieldElement b, java.math.BigInteger curveOrder)
          Gets the default implementation, defined by the default coordinate typ and the provided field element typ.
static ECGroupFactory getInstance()
          Creates an instance of the concrete factory.
static int getPrimePrecompWindowSize()
          Returns the window size used by the Comb2 precomputation method for prime curves.
static void setDefaultFactory(ECGroupFactory factory)
          Sets the factory that sould be used.
static void setPrimePrecompWindowSize(int w)
          Set the window size used by the Comb2 precomputation method for prime curves.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ECGroupFactory

protected ECGroupFactory()
Implemented as singleton. Subclasses use this constructor. Use the static getInstance method to obtain an instance.

Method Detail

getInstance

public static ECGroupFactory getInstance()
                                  throws ECGroupException
Creates an instance of the concrete factory. It uses the SimpleECGroupFactory class if no other implementation was defined by the setDefaultFactory method.

Throws:
ECGroupException

getPrimePrecompWindowSize

public static int getPrimePrecompWindowSize()
Returns the window size used by the Comb2 precomputation method for prime curves.

Returns:
the window size used by the Comb2 precomputation method for prime curves.
Throws:
java.lang.IllegalStateException - if method is called and speedUps are turned off.

setDefaultFactory

public static void setDefaultFactory(ECGroupFactory factory)
Sets the factory that sould be used. Has to be called if a custom implementation should to be used.

Parameters:
factory - the factory to be used.

setPrimePrecompWindowSize

public static void setPrimePrecompWindowSize(int w)
Set the window size used by the Comb2 precomputation method for prime curves. The value w defines how many points will be precomputed: #P = 2^(w+1). If w=0 no points will be precomputed and the WNAF(5) method is used instead. The default value is w=0 and thus no precomputation is used.

Parameters:
w - the window size
Throws:
java.lang.IllegalStateException - if method is called and speedUps are turned off.

getCurve

public abstract EllipticCurve getCurve(FieldElement a,
                                       FieldElement b,
                                       java.math.BigInteger curveOrder,
                                       int coordinateType)
                                throws ECGroupException
ATTENTION: Make sure that the curve parameter specify a valid elliptic curve and are elements of the same field.

Parameters:
a - the parameter "a" of an elliptic curve
b - the parameter "b" of an elliptic curve
curveOrder - if curve order is unknown specify the parameter with null
coordinateType - the type of coordinates to be used
Throws:
ECGroupException - if something went wrong or algorithms are not supported.
See Also:
CoordinateTypes

getDefault

public abstract EllipticCurve getDefault(FieldElement a,
                                         FieldElement b,
                                         java.math.BigInteger curveOrder)
                                  throws ECGroupException
Gets the default implementation, defined by the default coordinate typ and the provided field element typ. ATTENTION: Make sure that the curve parameter specify a valid elliptic curve and are elements of the same field.

Parameters:
a - the parameter "a" of an elliptic curve
b - the parameter "b" of an elliptic curve
curveOrder - if curve order is unknown specify the parameter with null.
Throws:
ECGroupException - if something went wrong or algorithms are not supported.

IAIK ECC
version 2.18

IAIK-ECC 2.18, (c) 2002 IAIK, (c) 2003 SIC