public class ECOperations
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ECOperations.IntermediateValueException |
| Modifier and Type | Field and Description |
|---|---|
static java.security.spec.ECPoint |
INFINITY |
static ECOperations |
SM2OPS |
| Constructor and Description |
|---|
ECOperations(IntegerModuloP b,
IntegerFieldModuloP orderField) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
allZero(byte[] arr) |
boolean |
checkOrder(java.security.spec.ECPoint point) |
static java.util.Optional<ECOperations> |
forParameters(java.security.spec.ECParameterSpec params) |
byte[] |
generatePrivateScalar(java.security.SecureRandom random) |
IntegerFieldModuloP |
getField() |
protected ProjectivePoint.Immutable |
getNeutral() |
IntegerFieldModuloP |
getOrderField() |
boolean |
isNeutral(Point p) |
MutablePoint |
multiply(AffinePoint affineP,
byte[] s)
Multiply an affine point by a scalar and return the result as a mutable
point.
|
MutablePoint |
multiply(java.security.spec.ECPoint ecPoint,
byte[] s) |
byte[] |
seedToScalar(byte[] seedBytes) |
void |
setSum(MutablePoint p,
AffinePoint p2) |
AffinePoint |
toAffinePoint(java.security.spec.ECPoint ecPoint) |
static java.security.spec.ECPoint |
toECPoint(Point point) |
public static final java.security.spec.ECPoint INFINITY
public static final ECOperations SM2OPS
public ECOperations(IntegerModuloP b, IntegerFieldModuloP orderField)
public static java.util.Optional<ECOperations> forParameters(java.security.spec.ECParameterSpec params)
public IntegerFieldModuloP getField()
public IntegerFieldModuloP getOrderField()
protected ProjectivePoint.Immutable getNeutral()
public boolean isNeutral(Point p)
public byte[] seedToScalar(byte[] seedBytes)
throws ECOperations.IntermediateValueException
public static boolean allZero(byte[] arr)
public MutablePoint multiply(AffinePoint affineP, byte[] s)
affineP - the points - the scalar as a little-endian arraypublic MutablePoint multiply(java.security.spec.ECPoint ecPoint, byte[] s)
public AffinePoint toAffinePoint(java.security.spec.ECPoint ecPoint)
public void setSum(MutablePoint p, AffinePoint p2)
public boolean checkOrder(java.security.spec.ECPoint point)
public byte[] generatePrivateScalar(java.security.SecureRandom random)
public static java.security.spec.ECPoint toECPoint(Point point)