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.100 x86.64 (2250, heads/master-3623a4e0d7, Nov 15 2023 18:16:06)