IAIK ECC
version 2.18

iaik.security.ecc.math.ecgroup
Class Coordinate

java.lang.Object
  extended byiaik.security.ecc.math.ecgroup.Coordinate
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
AffineCoordinate

public abstract class Coordinate
extends java.lang.Object
implements java.lang.Cloneable

The base class of all coordinates. It consists of x and y values (which are elements of a finite field).


Field Summary
protected  int coordinateType_
          The type of coordinates used.
protected  FieldElement x_
          the x coordinate
protected  FieldElement y_
          the y coordinate
 
Constructor Summary
protected Coordinate(FieldElement x, FieldElement y, int type)
          Used by subclasses.
 
Method Summary
 java.lang.Object clone()
           
abstract  boolean equals(java.lang.Object other)
           
 int getCoordinateType()
          Returns the coordinate id.
 FieldElement getX()
           
 FieldElement getY()
           
abstract  int hashCode()
          Returns the hash code of this value.
protected  void setX(FieldElement x)
           
protected  void setY(FieldElement y)
           
abstract  Coordinate toAffine()
          Transforms the current coordinate representation into affine coordinates.
abstract  iaik.asn1.OCTET_STRING toASN1Object()
          Elliptic Curve Points to Octet String Conversion Primitive or EC2OSP as defined in P1363.
 java.lang.String toString()
          A human readable coordinate representation.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

coordinateType_

protected int coordinateType_
The type of coordinates used.


x_

protected FieldElement x_
the x coordinate


y_

protected FieldElement y_
the y coordinate

Constructor Detail

Coordinate

protected Coordinate(FieldElement x,
                     FieldElement y,
                     int type)
Used by subclasses. The x and y coordinates are assigned.

Parameters:
x - the x coordinate
y - the y coordinate
type - the coordinate type.
See Also:
CoordinateTypes
Method Detail

clone

public java.lang.Object clone()
Returns:
a deep copy of this object.

equals

public abstract boolean equals(java.lang.Object other)
Parameters:
other - the other coordinate.
Returns:
true if all coordinates are equal.

getCoordinateType

public int getCoordinateType()
Returns the coordinate id.

Returns:
an integer defining the coordinate.
See Also:
CoordinateTypes

getX

public FieldElement getX()
Returns:
the x coordinate

getY

public FieldElement getY()
Returns:
the y coordinate

hashCode

public abstract int hashCode()
Returns the hash code of this value.

Returns:
the hash code of this value.

toAffine

public abstract Coordinate toAffine()
Transforms the current coordinate representation into affine coordinates. If the coordinates are already affine subclasses may simply return "this".

Returns:
the affine representation.

toASN1Object

public abstract iaik.asn1.OCTET_STRING toASN1Object()
Elliptic Curve Points to Octet String Conversion Primitive or EC2OSP as defined in P1363.

Returns:
the octet string ASN.1 structure

toString

public java.lang.String toString()
A human readable coordinate representation.

Returns:
all coordinates

setX

protected void setX(FieldElement x)
Parameters:
x - the x coordinate

setY

protected void setY(FieldElement y)
Parameters:
y - the y coordinate

IAIK ECC
version 2.18

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