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() 与其他素数算法的区


- C++ 和 Java 进程之间的共享内存 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01