本文整理汇总了Java中org.spongycastle.math.ec.FixedPointCombMultiplier类的典型用法代码示例。如果您正苦于以下问题:Java FixedPointCombMultiplier类的具体用法?Java FixedPointCombMultiplier怎么用?Java FixedPointCombMultiplier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FixedPointCombMultiplier类属于org.spongycastle.math.ec包,在下文中一共展示了FixedPointCombMultiplier类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: publicPointFromPrivate
import org.spongycastle.math.ec.FixedPointCombMultiplier; //导入依赖的package包/类
/**
* 根据私匙计算公匙
*
* @param privKey
* @return ECKey
*/
public static ECPoint publicPointFromPrivate(BigInteger privKey) {
if (privKey.bitLength() > CURVE.getN().bitLength()) {
privKey = privKey.mod(CURVE.getN());
}
return new FixedPointCombMultiplier().multiply(CURVE.getG(), privKey);
}
示例2: publicPointFromPrivate
import org.spongycastle.math.ec.FixedPointCombMultiplier; //导入依赖的package包/类
/**
* Returns public key point from the given private key. To convert a byte array into a BigInteger, use <tt>
* new BigInteger(1, bytes);</tt>
*/
public static ECPoint publicPointFromPrivate(BigInteger privKey) {
/*
* TODO: FixedPointCombMultiplier currently doesn't support scalars longer than the group order,
* but that could change in future versions.
*/
if (privKey.bitLength() > CURVE.getN().bitLength()) {
privKey = privKey.mod(CURVE.getN());
}
return new FixedPointCombMultiplier().multiply(CURVE.getG(), privKey);
}
示例3: publicPointFromPrivate
import org.spongycastle.math.ec.FixedPointCombMultiplier; //导入依赖的package包/类
/**
* Returns public key point from the given private key. To convert a byte
* array into a BigInteger, use <tt>
* new BigInteger(1, bytes);</tt>
*/
public static ECPoint publicPointFromPrivate(BigInteger privKey) {
/*
* TODO: FixedPointCombMultiplier currently doesn't support scalars
* longer than the group order, but that could change in future
* versions.
*/
if (privKey.bitLength() > CURVE.getN().bitLength()) {
privKey = privKey.mod(CURVE.getN());
}
return new FixedPointCombMultiplier().multiply(CURVE.getG(), privKey);
}