The math.primes.safe vocabulary implements words to calculate safe prime numbers. Safe primes are of the form p = 2q + 1, where p, q are prime. Safe primes have desirable qualities for cryptographic applications.

Testing if a number is a safe prime:

Generating safe prime numbers:

Testing if a number is a safe prime:

safe-prime? ( q -- ? )

Generating safe prime numbers:

next-safe-prime ( n -- q )

random-safe-prime ( numbits -- p )

This documentation was generated offline from a
`load-all`

image. If you want, you can also
browse the documentation from within the UI developer tools. See
the Factor website
for more information.

Factor 0.99 x86.64 (2203, heads/master-424edf64aa, Mar 8 2023 13:48:50)