IAIK ECC
version 2.18

iaik.security.ecc.util
Interface PointCoDec

All Known Implementing Classes:
PointCoDecImpl

public interface PointCoDec

Interface defining the EC point encoding, allowing. For instance one might want to use a point compression algorithm.


Field Summary
static int COMPRESSED
          Identifier for the compression algorithm.
static byte PC_COMPRESSED
          The bit mask for compressed points.
static byte PC_UNCOMPRESSED
          The bit mask for uncompressed points.
static int UNCOMPRESSED
          Identifier for the compression algorithm.
 
Method Summary
 AffineCoordinate decodePoint(byte[] encodedPoint, EllipticCurve ec)
          Decodes an encoded EC point.
 byte[] encodePoint(AffineCoordinate coordinate, int compressionAlgorithm)
          Encodes the x and y coordinate of an EC point.
 int getSupportedCompressions()
          Returns all supported compression algorithms.
 

Field Detail

COMPRESSED

public static final int COMPRESSED
Identifier for the compression algorithm. Use the default compression algorithm as described in ANSI X9.62 and IEEE 1363.

See Also:
Constant Field Values

PC_COMPRESSED

public static final byte PC_COMPRESSED
The bit mask for compressed points. Used as first byte in the encoded form.

See Also:
Constant Field Values

PC_UNCOMPRESSED

public static final byte PC_UNCOMPRESSED
The bit mask for uncompressed points. Used as first byte in the encoded form.

See Also:
Constant Field Values

UNCOMPRESSED

public static final int UNCOMPRESSED
Identifier for the compression algorithm. Use the uncompressed point encoding.

See Also:
Constant Field Values
Method Detail

decodePoint

public AffineCoordinate decodePoint(byte[] encodedPoint,
                                    EllipticCurve ec)
                             throws ECCException
Decodes an encoded EC point.

Parameters:
encodedPoint - the encoded point
ec - the elliptic curve the point is on.
Returns:
the coordinates of the encoded point
Throws:
ECCException - if the decoding algorithm is not implemented (e.g. point decompression)

encodePoint

public byte[] encodePoint(AffineCoordinate coordinate,
                          int compressionAlgorithm)
                   throws ECCException
Encodes the x and y coordinate of an EC point.

Parameters:
coordinate - the coordinate to be encoded.
compressionAlgorithm - determines whether a compression is used or not.
Returns:
the encoded point as required by the ASN.1 syntax.
Throws:
ECCException - if the point compression algorithm is not supported.

getSupportedCompressions

public int getSupportedCompressions()
Returns all supported compression algorithms.

Returns:
one of the defined constants or combination of them.

IAIK ECC
version 2.18

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