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, andSM9P256V1Pointrefuses to write the compressed form the curve could not read back.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, andSM9P256V1Pointrefuses to write the compressed form the curve could not read back. The SM9 prime is q = 5 mod 8, so a root would take a single exponentiation by Atkin's method rather than the simple exponent SM2 uses for its q = 3 mod 4 prime. Returns null (no root available).- Specified by:
sqrtin classECFieldElement
-
equals
-
hashCode
-