IAIK ECC
version 2.18

iaik.security.ecc.math.field
Class BinaryFieldFactory

java.lang.Object
  extended byiaik.security.ecc.math.field.BinaryFieldFactory
All Implemented Interfaces:
FieldFactory

public abstract class BinaryFieldFactory
extends java.lang.Object
implements FieldFactory

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

Use the static getInstance method to obtain an instance of the binary field factory. The implementing factory class for a specific irreducible polynomial can be set by the setDefaultFactory method.


Field Summary
protected  int[] irreducible_
          The irreducible polynomial for which this instance of a BinaryFieldFactory creates a BinaryField.
 
Constructor Summary
BinaryFieldFactory()
           
 
Method Summary
abstract  Field getField()
          Creates a new (factory specific) implementation of a binary field.
static FieldFactory getInstance(int[] irreducible)
          Use this method to get a concrete instance of the factory for a specifis irreducible polynomial.
static void setDefaultFactory(java.lang.Class factory, int[] irreducible)
          Set the field factory to be used for a specific irreducible polynomial.
protected  void setIrreducible(int[] irreducible)
          This method is used to set the irreducible polynomial after creating an instance of a BinaryFieldFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

irreducible_

protected int[] irreducible_
The irreducible polynomial for which this instance of a BinaryFieldFactory creates a BinaryField.

Constructor Detail

BinaryFieldFactory

public BinaryFieldFactory()
Method Detail

getInstance

public static FieldFactory getInstance(int[] irreducible)
                                throws FieldException
Use this method to get a concrete instance of the factory for a specifis irreducible polynomial.

Returns:
an implementation of a BinaryFieldFactory defined only for one irreducible polynomial.
Throws:
FieldException - if the irreducible polynomial is null or the class of a factory cannot be found.

setDefaultFactory

public static void setDefaultFactory(java.lang.Class factory,
                                     int[] irreducible)
Set the field factory to be used for a specific irreducible polynomial. To get an implementation of the factory use the getInstance method. This method should only be used if one wants to use a custom implementation of the binary field arithmetic. If irreducible polynomial is null the default factory is set, if the factory is null the factory defined for this irreducible polynomial is removed.

Parameters:
factory - the class of the field factory that should be used. If factory is null the factory defined for this irreducible polynomial is removed.
irreducible - the irreducible polynomial for that the factory is used. If irreducible is null the default factory is set.

getField

public abstract Field getField()
Creates a new (factory specific) implementation of a binary field. Use the newElement method to create a FieldElement for this field.

Specified by:
getField in interface FieldFactory
See Also:
FieldElement

setIrreducible

protected void setIrreducible(int[] irreducible)
This method is used to set the irreducible polynomial after creating an instance of a BinaryFieldFactory.

Parameters:
irreducible -

IAIK ECC
version 2.18

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