本文整理了Java中org.bouncycastle.math.ec.ECPoint.twicePlus()
方法的一些代码示例,展示了ECPoint.twicePlus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ECPoint.twicePlus()
方法的具体详情如下:
包路径:org.bouncycastle.math.ec.ECPoint
类名称:ECPoint
方法名:twicePlus
暂无
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public ECPoint threeTimes()
{
return twicePlus(this);
}
代码示例来源:origin: redfish64/TinyTravelTracker
public ECPoint threeTimes()
{
return twicePlus(this);
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
/**
* Joye's double-add algorithm.
*/
protected ECPoint multiplyPositive(ECPoint p, BigInteger k)
{
ECPoint[] R = new ECPoint[]{ p.getCurve().getInfinity(), p };
int n = k.bitLength();
for (int i = 0; i < n; ++i)
{
int b = k.testBit(i) ? 1 : 0;
int bp = 1 - b;
R[bp] = R[bp].twicePlus(R[b]);
}
return R[0];
}
}
代码示例来源:origin: redfish64/TinyTravelTracker
/**
* Joye's double-add algorithm.
*/
protected ECPoint multiplyPositive(ECPoint p, BigInteger k)
{
ECPoint[] R = new ECPoint[]{ p.getCurve().getInfinity(), p };
int n = k.bitLength();
for (int i = 0; i < n; ++i)
{
int b = k.testBit(i) ? 1 : 0;
int bp = 1 - b;
R[bp] = R[bp].twicePlus(R[b]);
}
return R[0];
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
/**
* 'Zeroless' Signed Digit Left-to-Right.
*/
protected ECPoint multiplyPositive(ECPoint p, BigInteger k)
{
ECPoint addP = p.normalize(), subP = addP.negate();
ECPoint R0 = addP;
int n = k.bitLength();
int s = k.getLowestSetBit();
int i = n;
while (--i > s)
{
R0 = R0.twicePlus(k.testBit(i) ? addP : subP);
}
R0 = R0.timesPow2(s);
return R0;
}
}
代码示例来源:origin: redfish64/TinyTravelTracker
/**
* 'Zeroless' Signed Digit Left-to-Right.
*/
protected ECPoint multiplyPositive(ECPoint p, BigInteger k)
{
ECPoint addP = p.normalize(), subP = addP.negate();
ECPoint R0 = addP;
int n = k.bitLength();
int s = k.getLowestSetBit();
int i = n;
while (--i > s)
{
R0 = R0.twicePlus(k.testBit(i) ? addP : subP);
}
R0 = R0.timesPow2(s);
return R0;
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
R = R.twicePlus(r);
代码示例来源:origin: redfish64/TinyTravelTracker
R = R.twicePlus(r);
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
ECPoint r = table[n >>> 1];
R = R.twicePlus(r);
R = R.timesPow2(zeroes);
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
protected ECPoint multiplyPositive(ECPoint p, BigInteger k)
{
int[] naf = WNafUtil.generateCompactNaf(k);
ECPoint addP = p.normalize(), subP = addP.negate();
ECPoint R = p.getCurve().getInfinity();
int i = naf.length;
while (--i >= 0)
{
int ni = naf[i];
int digit = ni >> 16, zeroes = ni & 0xFFFF;
R = R.twicePlus(digit < 0 ? subP : addP);
R = R.timesPow2(zeroes);
}
return R;
}
}
代码示例来源:origin: redfish64/TinyTravelTracker
ECPoint r = table[n >>> 1];
R = R.twicePlus(r);
R = R.timesPow2(zeroes);
代码示例来源:origin: redfish64/TinyTravelTracker
protected ECPoint multiplyPositive(ECPoint p, BigInteger k)
{
int[] naf = WNafUtil.generateCompactNaf(k);
ECPoint addP = p.normalize(), subP = addP.negate();
ECPoint R = p.getCurve().getInfinity();
int i = naf.length;
while (--i >= 0)
{
int ni = naf[i];
int digit = ni >> 16, zeroes = ni & 0xFFFF;
R = R.twicePlus(digit < 0 ? subP : addP);
R = R.timesPow2(zeroes);
}
return R;
}
}
代码示例来源:origin: redfish64/TinyTravelTracker
R = R.twicePlus(lookupTable[index]);
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
R = R.twicePlus(r);
代码示例来源:origin: redfish64/TinyTravelTracker
R = R.twicePlus(r);
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
R = R.twicePlus(add);
代码示例来源:origin: redfish64/TinyTravelTracker
static ECPoint implShamirsTrickJsf(ECPoint P, BigInteger k,
ECPoint Q, BigInteger l)
{
ECCurve curve = P.getCurve();
ECPoint infinity = curve.getInfinity();
// TODO conjugate co-Z addition (ZADDC) can return both of these
ECPoint PaddQ = P.add(Q);
ECPoint PsubQ = P.subtract(Q);
ECPoint[] points = new ECPoint[]{ Q, PsubQ, P, PaddQ };
curve.normalizeAll(points);
ECPoint[] table = new ECPoint[] {
points[3].negate(), points[2].negate(), points[1].negate(),
points[0].negate(), infinity, points[0],
points[1], points[2], points[3] };
byte[] jsf = WNafUtil.generateJSF(k, l);
ECPoint R = infinity;
int i = jsf.length;
while (--i >= 0)
{
int jsfi = jsf[i];
// NOTE: The shifting ensures the sign is extended correctly
int kDigit = ((jsfi << 24) >> 28), lDigit = ((jsfi << 28) >> 28);
int index = 4 + (kDigit * 3) + lDigit;
R = R.twicePlus(table[index]);
}
return R;
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
static ECPoint implShamirsTrickJsf(ECPoint P, BigInteger k,
ECPoint Q, BigInteger l)
{
ECCurve curve = P.getCurve();
ECPoint infinity = curve.getInfinity();
// TODO conjugate co-Z addition (ZADDC) can return both of these
ECPoint PaddQ = P.add(Q);
ECPoint PsubQ = P.subtract(Q);
ECPoint[] points = new ECPoint[]{ Q, PsubQ, P, PaddQ };
curve.normalizeAll(points);
ECPoint[] table = new ECPoint[] {
points[3].negate(), points[2].negate(), points[1].negate(),
points[0].negate(), infinity, points[0],
points[1], points[2], points[3] };
byte[] jsf = WNafUtil.generateJSF(k, l);
ECPoint R = infinity;
int i = jsf.length;
while (--i >= 0)
{
int jsfi = jsf[i];
// NOTE: The shifting ensures the sign is extended correctly
int kDigit = ((jsfi << 24) >> 28), lDigit = ((jsfi << 28) >> 28);
int index = 4 + (kDigit * 3) + lDigit;
R = R.twicePlus(table[index]);
}
return R;
}
内容来源于网络,如有侵权,请联系作者删除!