org.bouncycastle.math.ec.custom.gm
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
- public class SM9P256V1FieldElement
- extends ECFieldElement.AbstractFp
Element of the SM9 G1 base field F_q, held in Montgomery form (see
SM9P256V1Field).
|
Field Summary |
static java.math.BigInteger |
Q
|
protected int[] |
x
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Q
public static final java.math.BigInteger Q
x
protected int[] x
SM9P256V1FieldElement
public SM9P256V1FieldElement(java.math.BigInteger x)
SM9P256V1FieldElement
public SM9P256V1FieldElement()
SM9P256V1FieldElement
protected SM9P256V1FieldElement(int[] x)
isZero
public boolean isZero()
- Overrides:
isZero in class ECFieldElement
isOne
public boolean isOne()
- Overrides:
isOne in class ECFieldElement
testBitZero
public boolean testBitZero()
- Overrides:
testBitZero in class ECFieldElement
toBigInteger
public java.math.BigInteger toBigInteger()
- Specified by:
toBigInteger in class ECFieldElement
getFieldName
public java.lang.String getFieldName()
- Specified by:
getFieldName in class ECFieldElement
getFieldSize
public int getFieldSize()
- Specified by:
getFieldSize in class ECFieldElement
add
public ECFieldElement add(ECFieldElement b)
- Specified by:
add in class ECFieldElement
addOne
public ECFieldElement addOne()
- Specified by:
addOne in class ECFieldElement
subtract
public ECFieldElement subtract(ECFieldElement b)
- Specified by:
subtract in class ECFieldElement
multiply
public ECFieldElement multiply(ECFieldElement b)
- Specified by:
multiply in class ECFieldElement
divide
public ECFieldElement divide(ECFieldElement b)
- Specified by:
divide in class ECFieldElement
negate
public ECFieldElement negate()
- Specified by:
negate in class ECFieldElement
square
public ECFieldElement square()
- Specified by:
square in class ECFieldElement
invert
public ECFieldElement invert()
- Specified by:
invert in class ECFieldElement
sqrt
public ECFieldElement 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:
sqrt in class ECFieldElement
equals
public boolean equals(java.lang.Object other)
hashCode
public int hashCode()