我目前正在从事实施椭圆曲线密码术的项目。我为此使用BouncyCastle,他们在其中预先构建了函数来处理它。
我从一个非常基本的东西开始,只是为了了解一切如何工作,但是我已经遇到了问题。 我正在尝试点乘法:
ECPoint tmp3;
ECPoint tmp1 = ecSpec.getCurve().createPoint(new BigInteger("23"),new BigInteger("123"));
BigInteger tmp2 = new BigInteger("12");
tmp3 = tmp1.multiply(tmp2);
但是这会返回运行时错误:
Exception in thread "main" java.lang.IllegalStateException: Invalid result
at org.bouncycastle.math.ec.ECAlgorithms.implCheckResult(Unknown Source)
at org.bouncycastle.math.ec.AbstractECMultiplier.checkResult(Unknown Source)
at org.bouncycastle.math.ec.AbstractECMultiplier.multiply(Unknown Source)
at org.bouncycastle.math.ec.ECPoint.multiply(Unknown Source)
at test.ecc_test.main(ecc_test.java:85)
要添加的几点:
任何建议将不胜感激!
谢谢