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 (2276, heads/master-0d4745fa92, Jul 20 2024 17:55:06)