Expand description

Quick Start

Contained within this module are two functions:

  • is_witness
  • is_prime

The function is_witness performs a single iteration of the Miller-Rabin primality test.

On the other hand, is_prime is a routine that performs the Miller-Rabin primality test a given number of times in parallel, exiting as soon as the iterator encounters a witness for the compositeness of the tested integer.

Functions

Test whether an integer n is likely prime using the Miller-Rabin primality test.

Test whether an integer a is a witness for the compositeness of n.