Bouncy Castle Cryptography Library 1.87

org.bouncycastle.math.ec.custom.gm
Class SM9P256V1Point

java.lang.Object
  extended byorg.bouncycastle.math.ec.ECPoint
      extended byorg.bouncycastle.math.ec.ECPoint.AbstractFp
          extended byorg.bouncycastle.math.ec.custom.gm.SM9P256V1Point

public class SM9P256V1Point
extends ECPoint.AbstractFp

Jacobian-coordinate point of the SM9 G1 curve y^2 = x^3 + 5 (a = 0) over SM9P256V1Field.

The group law is the standard a=0 Jacobian addition (add-2007-bl) and doubling (dbl-2009-l), written in terms of the ECFieldElement operations so it is correct over the Montgomery-form field. (It does not use the Solinas-specific int[]-level fused reductions that SM2P256V1Point relies on, which are not valid for a Montgomery representation.)


Nested Class Summary
 
Nested classes inherited from class org.bouncycastle.math.ec.ECPoint
ECPoint.AbstractF2m, ECPoint.AbstractFp, ECPoint.F2m, ECPoint.Fp
 
Field Summary
 
Fields inherited from class org.bouncycastle.math.ec.ECPoint
curve, EMPTY_ZS, preCompTable, x, y, zs
 
Method Summary
 ECPoint add(ECPoint b)
           
protected  ECPoint detach()
           
 void encodeTo(boolean compressed, byte[] buf, int off)
          Only the uncompressed encoding is written.
 int getEncodedLength(boolean compressed)
          The compressed length is refused, as encodeTo(boolean, byte[], int) refuses the compressed encoding itself.
 ECPoint negate()
           
 ECPoint threeTimes()
           
 ECPoint twice()
           
 ECPoint twicePlus(ECPoint b)
           
 
Methods inherited from class org.bouncycastle.math.ec.ECPoint.AbstractFp
getCompressionYTilde, satisfiesCurveEquation, subtract
 
Methods inherited from class org.bouncycastle.math.ec.ECPoint
checkNormalized, createScaledPoint, equals, equals, getAffineXCoord, getAffineYCoord, getCurve, getCurveCoordinateSystem, getDetachedPoint, getEncoded, getInitialZCoords, getRawXCoord, getRawYCoord, getRawZCoords, getXCoord, getYCoord, getZCoord, getZCoords, hashCode, isInfinity, isNormalized, isValid, multiply, normalize, satisfiesOrder, scaleX, scaleXNegateY, scaleY, scaleYNegateX, timesPow2, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

detach

protected ECPoint detach()
Specified by:
detach in class ECPoint

getEncodedLength

public int getEncodedLength(boolean compressed)
The compressed length is refused, as encodeTo(boolean, byte[], int) refuses the compressed encoding itself.

Overrides:
getEncodedLength in class ECPoint

encodeTo

public void encodeTo(boolean compressed,
                     byte[] buf,
                     int off)
Only the uncompressed encoding is written. The SM9 G1 curve cannot decompress a point - its field has no square root, see SM9P256V1FieldElement.sqrt() - so a compressed encoding written here was one ECCurve.decodePoint(byte[]) on the same curve then refused. The point at infinity keeps its one-octet encoding, which decodes.

Overrides:
encodeTo in class ECPoint
Throws:
java.lang.UnsupportedOperationException - if compressed is true for a finite point.

add

public ECPoint add(ECPoint b)
Specified by:
add in class ECPoint

twice

public ECPoint twice()
Specified by:
twice in class ECPoint

twicePlus

public ECPoint twicePlus(ECPoint b)
Overrides:
twicePlus in class ECPoint

threeTimes

public ECPoint threeTimes()
Overrides:
threeTimes in class ECPoint

negate

public ECPoint negate()
Specified by:
negate in class ECPoint

Bouncy Castle Cryptography Library 1.87