|
IAIK ECC version 2.18 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.security.ecc.util.PointCoDecImpl
Implements the PointCodec Interface. Tries to load the Pointcompressor class and if the succeeds the point compression is enabled.
Field Summary | |
protected PointCompressor |
decompressor_
The compressor implementation. |
protected int |
supportedCompressions_
depends on the supported compression methods. |
protected boolean |
verifyOnCurve_
if true the getPoint method evaluates if the new point is indeed on the curve. |
Fields inherited from interface iaik.security.ecc.util.PointCoDec |
COMPRESSED, PC_COMPRESSED, PC_UNCOMPRESSED, UNCOMPRESSED |
Constructor Summary | |
protected |
PointCoDecImpl()
Default constructor tries to load the decompressor class and if this succeeds the point compression will be available. |
Method Summary | |
protected AffineCoordinate |
compressed(byte[] point,
EllipticCurve curve)
Performs the Octet String to Point conversation for compressed points. |
AffineCoordinate |
decodePoint(byte[] encodedPoint,
EllipticCurve curve)
Performs the Octet String to Point conversation as defined in ANSI X9.62. |
byte[] |
encodePoint(AffineCoordinate coordinate,
int compressionAlgorithm)
Encodes the coordinates. |
int |
getSupportedCompressions()
Returns all supported compression algorithms. |
boolean |
getVerifyPoint()
The last step of the Octet String to Point conversation can check if the calculated point indeed is on the curve. |
void |
setVerifyPoint(boolean doCheck)
The last step of the Octet String to Point conversation can check if the calculated point indeed is on the curve. |
protected AffineCoordinate |
uncompressed(byte[] point,
EllipticCurve curve)
Performs the Octet String to Point conversation for uncompressed points |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected PointCompressor decompressor_
null
point compression is disabled.
protected int supportedCompressions_
protected boolean verifyOnCurve_
Constructor Detail |
protected PointCoDecImpl()
Method Detail |
public AffineCoordinate decodePoint(byte[] encodedPoint, EllipticCurve curve) throws ECCException
decodePoint
in interface PointCoDec
encodedPoint
- the encoded point as byte array.curve
- the elliptic curve containing the encoded point.
ECCException
- if the decoding algorithm is not implemented (e.g. point decompression)PointCompressor
public byte[] encodePoint(AffineCoordinate coordinate, int compressionAlgorithm) throws ECCException
encodePoint
in interface PointCoDec
coordinate
- the X and Y coordinates to be encodedcompressionAlgorithm
- the allowed compression algorithm(s). If more than one the uncompressed form will be used.
ECCException
- if the point compression algorithm is not supported.PointCoDec.encodePoint(iaik.security.ecc.math.ecgroup.AffineCoordinate, int)
public int getSupportedCompressions()
PointCoDec
getSupportedCompressions
in interface PointCoDec
PointCoDec.getSupportedCompressions()
public boolean getVerifyPoint()
public void setVerifyPoint(boolean doCheck)
doCheck
- if true the check will be performedprotected AffineCoordinate compressed(byte[] point, EllipticCurve curve) throws ECCException
point
- the octet string to be converted into a point, including the PC byte.curve
- the elliptic curve, where the point should be on.
ECCException
- if the point data is invalid or the implementation is not availableprotected AffineCoordinate uncompressed(byte[] point, EllipticCurve curve) throws ECCException
point
- the octet string to be converted into a point, including the PC byte.curve
- the elliptic curve, where the point should be on.
ECCException
- if the point data is invalid
|
IAIK ECC version 2.18 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |