p
算法中生成DSA
。我不明白:|| pTemp.bitLength() != l
语句中do while
,因为这意味着我只查找1
数字素数为2,5,7?这是无稽之谈。
private BigInteger generateP(BigInteger q, int l) {
if (l % 64 != 0) {
throw new IllegalArgumentException("L value is wrong");
}
BigInteger pTemp;
BigInteger pTemp2;
int i = 0;
do {
//pTemp = new BigInteger(l, primeCenterie, rand); <--- this is useless also?
pTemp = new BigInteger(l, rand);
pTemp2 = pTemp.subtract(BigInteger.ONE);
pTemp = pTemp.subtract(pTemp2.remainder(q));
System.out.println("1 " + i++);
} while (!pTemp.isProbablePrime(primeCenterie) || pTemp.bitLength() != l);
return pTemp;
}
答案 0 :(得分:0)
IT不是1(一)但是l(L)一切都还可以。我是2个月前做的,现在不明白。