本文整理了Java中org.bouncycastle.math.ec.ECCurve.getCoordinateSystem()
方法的一些代码示例,展示了ECCurve.getCoordinateSystem()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ECCurve.getCoordinateSystem()
方法的具体详情如下:
包路径:org.bouncycastle.math.ec.ECCurve
类名称:ECCurve
方法名:getCoordinateSystem
暂无
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
protected int getCurveCoordinateSystem()
{
// Cope with null curve, most commonly used by implicitlyCa
return null == curve ? ECCurve.COORD_AFFINE : curve.getCoordinateSystem();
}
代码示例来源:origin: redfish64/TinyTravelTracker
protected int getCurveCoordinateSystem()
{
// Cope with null curve, most commonly used by implicitlyCa
return null == curve ? ECCurve.COORD_AFFINE : curve.getCoordinateSystem();
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
protected static ECFieldElement[] getInitialZCoords(ECCurve curve)
{
// Cope with null curve, most commonly used by implicitlyCa
int coord = null == curve ? ECCurve.COORD_AFFINE : curve.getCoordinateSystem();
switch (coord)
{
case ECCurve.COORD_AFFINE:
case ECCurve.COORD_LAMBDA_AFFINE:
return EMPTY_ZS;
default:
break;
}
ECFieldElement one = curve.fromBigInteger(ECConstants.ONE);
switch (coord)
{
case ECCurve.COORD_HOMOGENEOUS:
case ECCurve.COORD_JACOBIAN:
case ECCurve.COORD_LAMBDA_PROJECTIVE:
return new ECFieldElement[]{ one };
case ECCurve.COORD_JACOBIAN_CHUDNOVSKY:
return new ECFieldElement[]{ one, one, one };
case ECCurve.COORD_JACOBIAN_MODIFIED:
return new ECFieldElement[]{ one, curve.getA() };
default:
throw new IllegalArgumentException("unknown coordinate system");
}
}
代码示例来源:origin: redfish64/TinyTravelTracker
protected static ECFieldElement[] getInitialZCoords(ECCurve curve)
{
// Cope with null curve, most commonly used by implicitlyCa
int coord = null == curve ? ECCurve.COORD_AFFINE : curve.getCoordinateSystem();
switch (coord)
{
case ECCurve.COORD_AFFINE:
case ECCurve.COORD_LAMBDA_AFFINE:
return EMPTY_ZS;
default:
break;
}
ECFieldElement one = curve.fromBigInteger(ECConstants.ONE);
switch (coord)
{
case ECCurve.COORD_HOMOGENEOUS:
case ECCurve.COORD_JACOBIAN:
case ECCurve.COORD_LAMBDA_PROJECTIVE:
return new ECFieldElement[]{ one };
case ECCurve.COORD_JACOBIAN_CHUDNOVSKY:
return new ECFieldElement[]{ one, one, one };
case ECCurve.COORD_JACOBIAN_MODIFIED:
return new ECFieldElement[]{ one, curve.getA() };
default:
throw new IllegalArgumentException("unknown coordinate system");
}
}
代码示例来源:origin: redfish64/TinyTravelTracker
protected ECCurve configureCurve(ECCurve c, int coord)
{
if (c.getCoordinateSystem() == coord)
{
return c;
}
if (!c.supportsCoordinateSystem(coord))
{
throw new IllegalArgumentException("Coordinate system " + coord + " not supported by this curve");
}
return c.configure().setCoordinateSystem(coord).create();
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
protected ECCurve configureCurve(ECCurve c, int coord)
{
if (c.getCoordinateSystem() == coord)
{
return c;
}
if (!c.supportsCoordinateSystem(coord))
{
throw new IllegalArgumentException("Coordinate system " + coord + " not supported by this curve");
}
return c.configure().setCoordinateSystem(coord).create();
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public ECPoint negate()
{
if (this.isInfinity())
{
return this;
}
ECCurve curve = this.getCurve();
int coord = curve.getCoordinateSystem();
if (ECCurve.COORD_AFFINE != coord)
{
return new ECPoint.Fp(curve, this.x, this.y.negate(), this.zs, this.withCompression);
}
return new ECPoint.Fp(curve, this.x, this.y.negate(), this.withCompression);
}
代码示例来源:origin: redfish64/TinyTravelTracker
public ECPoint negate()
{
if (this.isInfinity())
{
return this;
}
ECCurve curve = this.getCurve();
int coord = curve.getCoordinateSystem();
if (ECCurve.COORD_AFFINE != coord)
{
return new ECPoint.Fp(curve, this.x, this.y.negate(), this.zs, this.withCompression);
}
return new ECPoint.Fp(curve, this.x, this.y.negate(), this.withCompression);
}
代码示例来源:origin: redfish64/TinyTravelTracker
switch (this.getCoordinateSystem())
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
switch (this.getCoordinateSystem())
代码示例来源:origin: redfish64/TinyTravelTracker
public ECPoint.F2m tau()
{
if (this.isInfinity())
{
return this;
}
ECCurve curve = this.getCurve();
int coord = curve.getCoordinateSystem();
ECFieldElement X1 = this.x;
switch (coord)
{
case ECCurve.COORD_AFFINE:
case ECCurve.COORD_LAMBDA_AFFINE:
{
ECFieldElement Y1 = this.y;
return new ECPoint.F2m(curve, X1.square(), Y1.square(), this.withCompression);
}
case ECCurve.COORD_HOMOGENEOUS:
case ECCurve.COORD_LAMBDA_PROJECTIVE:
{
ECFieldElement Y1 = this.y, Z1 = this.zs[0];
return new ECPoint.F2m(curve, X1.square(), Y1.square(), new ECFieldElement[]{ Z1.square() }, this.withCompression);
}
default:
{
throw new IllegalStateException("unsupported coordinate system");
}
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public ECPoint.AbstractF2m tau()
{
if (this.isInfinity())
{
return this;
}
ECCurve curve = this.getCurve();
int coord = curve.getCoordinateSystem();
ECFieldElement X1 = this.x;
switch (coord)
{
case ECCurve.COORD_AFFINE:
case ECCurve.COORD_LAMBDA_AFFINE:
{
ECFieldElement Y1 = this.y;
return (ECPoint.AbstractF2m)curve.createRawPoint(X1.square(), Y1.square(), this.withCompression);
}
case ECCurve.COORD_HOMOGENEOUS:
case ECCurve.COORD_LAMBDA_PROJECTIVE:
{
ECFieldElement Y1 = this.y, Z1 = this.zs[0];
return (ECPoint.AbstractF2m)curve.createRawPoint(X1.square(), Y1.square(),
new ECFieldElement[]{ Z1.square() }, this.withCompression);
}
default:
{
throw new IllegalStateException("unsupported coordinate system");
}
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
int coord = curve.getCoordinateSystem();
代码示例来源:origin: redfish64/TinyTravelTracker
public ECPoint importPoint(ECPoint p)
{
if (this != p.getCurve() && this.getCoordinateSystem() == COORD_JACOBIAN && !p.isInfinity())
{
switch (p.getCurve().getCoordinateSystem())
{
case COORD_JACOBIAN:
case COORD_JACOBIAN_CHUDNOVSKY:
case COORD_JACOBIAN_MODIFIED:
return new ECPoint.Fp(this,
fromBigInteger(p.x.toBigInteger()),
fromBigInteger(p.y.toBigInteger()),
new ECFieldElement[]{ fromBigInteger(p.zs[0].toBigInteger()) },
p.withCompression);
default:
break;
}
}
return super.importPoint(p);
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public ECPoint importPoint(ECPoint p)
{
if (this != p.getCurve() && this.getCoordinateSystem() == ECCurve.COORD_JACOBIAN && !p.isInfinity())
{
switch (p.getCurve().getCoordinateSystem())
{
case ECCurve.COORD_JACOBIAN:
case ECCurve.COORD_JACOBIAN_CHUDNOVSKY:
case ECCurve.COORD_JACOBIAN_MODIFIED:
return new ECPoint.Fp(this,
fromBigInteger(p.x.toBigInteger()),
fromBigInteger(p.y.toBigInteger()),
new ECFieldElement[]{ fromBigInteger(p.zs[0].toBigInteger()) },
p.withCompression);
default:
break;
}
}
return super.importPoint(p);
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
ECFieldElement X = this.x, A = curve.getA(), B = curve.getB();
int coord = curve.getCoordinateSystem();
if (coord == ECCurve.COORD_LAMBDA_PROJECTIVE)
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
int coord = curve.getCoordinateSystem();
代码示例来源:origin: redfish64/TinyTravelTracker
int coord = curve.getCoordinateSystem();
代码示例来源:origin: redfish64/TinyTravelTracker
int coord = curve.getCoordinateSystem();
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
int coord = curve.getCoordinateSystem();
内容来源于网络,如有侵权,请联系作者删除!