next-safe-prime ( n -- q )
Safe prime numbers
Prev:safe-prime? ( q -- ? )
Next:random-safe-prime ( numbits -- p )


Vocabulary
math.primes.safe

Inputs and outputs
nan integer
qan integer


Word description
Tests consecutive numbers and returns the next safe prime. A safe prime is desirable in cryptography applications such as Diffie-Hellman and SRP6.

Definition
USING: kernel math.primes.safe.private ;

IN: math.primes.safe

: next-safe-prime ( n -- q )
next-safe-prime-candidate dup safe-prime?
[ next-safe-prime ] unless ;