费马测试(Fermat test)

Some of the cryptographic algorithms make use of big prime numbers. However, checking if a big number is prime is not so easy. However, some probabilistic tests exist that offer high confidence at low cost. One of them is the Fermat test.
Let $a$ be a random number between $2$ and $n-1$ (being $n$ the number whose primality we are testing). Then, $n$ is probably prime if the following equation holds:
    $$a^n \bmod n = a$$
If a number passes the Fermat test several times then it is prime with a high probability.

费马小定理

若 $p$ 是素数,则对任意正整数 $x$ 都有

    $$x^p \equiv x \pmod{p}$$

相关文章:

  • 2022-02-07
  • 2022-12-23
  • 2021-04-01
  • 2021-09-23
  • 2022-01-11
  • 2021-10-08
  • 2021-10-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2021-11-14
  • 2021-06-21
  • 2021-10-17
  • 2021-07-02
相关资源
相似解决方案