Package org.bouncycastle.math.ec
Class ECFieldElement.Fp
- java.lang.Object
-
- org.bouncycastle.math.ec.ECFieldElement
-
- org.bouncycastle.math.ec.ECFieldElement.Fp
-
- All Implemented Interfaces:
ECConstants
- Enclosing class:
- ECFieldElement
public static class ECFieldElement.Fp extends ECFieldElement
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.bouncycastle.math.ec.ECFieldElement
ECFieldElement.F2m, ECFieldElement.Fp
-
-
Constructor Summary
Constructors Constructor Description Fp(BigInteger q, BigInteger x)Deprecated.Use ECCurve.fromBigInteger to construct field elements
-
Method Summary
-
Methods inherited from class org.bouncycastle.math.ec.ECFieldElement
bitLength, getEncoded, isOne, isZero, testBitZero, toString
-
-
-
-
Constructor Detail
-
Fp
public Fp(BigInteger q, BigInteger x)
Deprecated.Use ECCurve.fromBigInteger to construct field elements
-
-
Method Detail
-
toBigInteger
public BigInteger toBigInteger()
- Specified by:
toBigIntegerin classECFieldElement
-
getFieldName
public String getFieldName()
return the field name for this field.- Specified by:
getFieldNamein classECFieldElement- Returns:
- the string "Fp".
-
getFieldSize
public int getFieldSize()
- Specified by:
getFieldSizein classECFieldElement
-
getQ
public BigInteger getQ()
-
add
public ECFieldElement add(ECFieldElement b)
- Specified by:
addin classECFieldElement
-
addOne
public ECFieldElement addOne()
- Specified by:
addOnein classECFieldElement
-
subtract
public ECFieldElement subtract(ECFieldElement b)
- Specified by:
subtractin classECFieldElement
-
multiply
public ECFieldElement multiply(ECFieldElement b)
- Specified by:
multiplyin classECFieldElement
-
multiplyMinusProduct
public ECFieldElement multiplyMinusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y)
- Overrides:
multiplyMinusProductin classECFieldElement
-
multiplyPlusProduct
public ECFieldElement multiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y)
- Overrides:
multiplyPlusProductin classECFieldElement
-
divide
public ECFieldElement divide(ECFieldElement b)
- Specified by:
dividein classECFieldElement
-
negate
public ECFieldElement negate()
- Specified by:
negatein classECFieldElement
-
square
public ECFieldElement square()
- Specified by:
squarein classECFieldElement
-
squareMinusProduct
public ECFieldElement squareMinusProduct(ECFieldElement x, ECFieldElement y)
- Overrides:
squareMinusProductin classECFieldElement
-
squarePlusProduct
public ECFieldElement squarePlusProduct(ECFieldElement x, ECFieldElement y)
- Overrides:
squarePlusProductin classECFieldElement
-
invert
public ECFieldElement invert()
- Specified by:
invertin classECFieldElement
-
sqrt
public ECFieldElement sqrt()
return a sqrt root - the routine verifies that the calculation returns the right value - if none exists it returns null.- Specified by:
sqrtin classECFieldElement
-
modAdd
protected BigInteger modAdd(BigInteger x1, BigInteger x2)
-
modDouble
protected BigInteger modDouble(BigInteger x)
-
modHalf
protected BigInteger modHalf(BigInteger x)
-
modHalfAbs
protected BigInteger modHalfAbs(BigInteger x)
-
modInverse
protected BigInteger modInverse(BigInteger x)
-
modMult
protected BigInteger modMult(BigInteger x1, BigInteger x2)
-
modReduce
protected BigInteger modReduce(BigInteger x)
-
modSubtract
protected BigInteger modSubtract(BigInteger x1, BigInteger x2)
-
equals
public boolean equals(Object other)
Description copied from class:ObjectCompares this instance with the specified object and indicates if they are equal. In order to be equal,omust represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.The default implementation returns
trueonly ifthis == o. See Writing a correctequalsmethod if you intend implementing your ownequalsmethod.The general contract for the
equalsandObject.hashCode()methods is that ifequalsreturnstruefor any two objects, thenhashCode()must return the same value for these objects. This means that subclasses ofObjectusually override either both methods or neither of them.- Overrides:
equalsin classObject- Parameters:
other- the object to compare this instance with.- Returns:
trueif the specified object is equal to thisObject;falseotherwise.- See Also:
Object.hashCode()
-
hashCode
public int hashCode()
Description copied from class:ObjectReturns an integer hash code for this object. By contract, any two objects for whichObject.equals(java.lang.Object)returnstruemust return the same hash code value. This means that subclasses ofObjectusually override both methods or neither method.Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCodemethod if you intend implementing your ownhashCodemethod.- Overrides:
hashCodein classObject- Returns:
- this object's hash code.
- See Also:
Object.equals(java.lang.Object)
-
-