Package org.bouncycastle.math.ec
Class ECAlgorithms
- java.lang.Object
-
- org.bouncycastle.math.ec.ECAlgorithms
-
public class ECAlgorithms extends Object
-
-
Constructor Summary
Constructors Constructor Description ECAlgorithms()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ECPointimportPoint(ECCurve c, ECPoint p)static booleanisF2mCurve(ECCurve c)static booleanisFpCurve(ECCurve c)static voidmontgomeryTrick(ECFieldElement[] zs, int off, int len)static voidmontgomeryTrick(ECFieldElement[] zs, int off, int len, ECFieldElement scale)static ECPointreferenceMultiply(ECPoint p, BigInteger k)Simple shift-and-add multiplication.static ECPointshamirsTrick(ECPoint P, BigInteger k, ECPoint Q, BigInteger l)static ECPointsumOfMultiplies(ECPoint[] ps, BigInteger[] ks)static ECPointsumOfTwoMultiplies(ECPoint P, BigInteger a, ECPoint Q, BigInteger b)static ECPointvalidatePoint(ECPoint p)
-
-
-
Method Detail
-
isF2mCurve
public static boolean isF2mCurve(ECCurve c)
-
isFpCurve
public static boolean isFpCurve(ECCurve c)
-
sumOfMultiplies
public static ECPoint sumOfMultiplies(ECPoint[] ps, BigInteger[] ks)
-
sumOfTwoMultiplies
public static ECPoint sumOfTwoMultiplies(ECPoint P, BigInteger a, ECPoint Q, BigInteger b)
-
shamirsTrick
public static ECPoint shamirsTrick(ECPoint P, BigInteger k, ECPoint Q, BigInteger l)
-
montgomeryTrick
public static void montgomeryTrick(ECFieldElement[] zs, int off, int len)
-
montgomeryTrick
public static void montgomeryTrick(ECFieldElement[] zs, int off, int len, ECFieldElement scale)
-
referenceMultiply
public static ECPoint referenceMultiply(ECPoint p, BigInteger k)
Simple shift-and-add multiplication. Serves as reference implementation to verify (possibly faster) implementations, and for very small scalars.- Parameters:
p- The point to multiply.k- The multiplier.- Returns:
- The result of the point multiplication
kP.
-
-