Difference between BigInteger.probablePrime() and other primality algorithms in java(Java 中 BigInteger.probablePrime() 与其他素数算法的区别)
问题描述
我正在使用 Java 实现一个 RSA 加密程序.现在我正在使用 BigInteger.probablePrime(1024, rnd) 来获取素数.这里 rnd 是由 Random rnd = new Random() 生成的随机数.我需要测试各种加密速度.
I am implementing an RSA encryption program using Java. Right now I am using BigInteger.probablePrime(1024, rnd) to get prime numbers. Here rnd is a random number generated by Random rnd = new Random() .
I need to test various speeds of encryption.
我的问题是:
BigInteger.probablePrime(1024, rnd)使用什么算法?
上面的算法和其他算法有什么区别:比如 Rabin-Miller、Fermats、Lucas-Lehmer?
what is the difference between the algorithm above and other algorithms: like Rabin-Miller, Fermats, Lucas-Lehmer?
谢谢.
推荐答案
BigInteger 的可能素数方法使用 Miller-Rabin 和 Lucas-Lehmer 算法来测试素数.
BigInteger's probable prime methods use both the Miller-Rabin and Lucas-Lehmer algorithms to test primality.
查看内部方法BigInteger.primeToCertainty代码>.
See the internal method BigInteger.primeToCertainty.
这篇关于Java 中 BigInteger.probablePrime() 与其他素数算法的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Java 中 BigInteger.probablePrime() 与其他素数算法的区
基础教程推荐
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 修改 void 函数的输入参数,然后读取 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
