Class SM9P256V1FieldElement
java.lang.Object
org.bouncycastle.math.ec.ECFieldElement
org.bouncycastle.math.ec.ECFieldElement.AbstractFp
org.bouncycastle.math.ec.custom.gm.SM9P256V1FieldElement
- All Implemented Interfaces:
ECConstants
Element of the SM9 G1 base field F_q, held in Montgomery form (see
SM9P256V1Field).-
Nested Class Summary
Nested classes/interfaces inherited from class ECFieldElement
ECFieldElement.AbstractF2m, ECFieldElement.AbstractFp, ECFieldElement.F2m, ECFieldElement.Fp -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddOne()booleanintinthashCode()invert()booleanisOne()booleanisZero()negate()sqrt()SM9 G1 uses only the uncompressed point encoding (0x04 || x || y), so square roots (needed only for compressed-point decoding) are not implemented for this internal curve.square()booleanMethods inherited from class ECFieldElement
bitLength, encodeTo, getEncoded, getEncodedLength, multiplyMinusProduct, multiplyPlusProduct, squareMinusProduct, squarePlusProduct, squarePow, toString
-
Field Details
-
Q
-
x
protected int[] x
-
-
Constructor Details
-
SM9P256V1FieldElement
-
SM9P256V1FieldElement
public SM9P256V1FieldElement() -
SM9P256V1FieldElement
protected SM9P256V1FieldElement(int[] x)
-
-
Method Details
-
isZero
public boolean isZero()- Overrides:
isZeroin classECFieldElement
-
isOne
public boolean isOne()- Overrides:
isOnein classECFieldElement
-
testBitZero
public boolean testBitZero()- Overrides:
testBitZeroin classECFieldElement
-
toBigInteger
- Specified by:
toBigIntegerin classECFieldElement
-
getFieldName
- Specified by:
getFieldNamein classECFieldElement
-
getFieldSize
public int getFieldSize()- Specified by:
getFieldSizein classECFieldElement
-
add
- Specified by:
addin classECFieldElement
-
addOne
- Specified by:
addOnein classECFieldElement
-
subtract
- Specified by:
subtractin classECFieldElement
-
multiply
- Specified by:
multiplyin classECFieldElement
-
divide
- Specified by:
dividein classECFieldElement
-
negate
- Specified by:
negatein classECFieldElement
-
square
- Specified by:
squarein classECFieldElement
-
invert
- Specified by:
invertin classECFieldElement
-
sqrt
SM9 G1 uses only the uncompressed point encoding (0x04 || x || y), so square roots (needed only for compressed-point decoding) are not implemented for this internal curve. The SM9 prime is q = 1 mod 4, which would require Tonelli-Shanks rather than the simple exponent used by SM2. Returns null (no root available).- Specified by:
sqrtin classECFieldElement
-
equals
-
hashCode
-