3.9 Number theory
All
Application
Manual
Name
Summary
Help
Documentation
Reference manual
Packages
SWI-Prolog SSL Interface
library(crypto): Cryptography and authentication library
Number theory
crypto_modular_inverse/3
crypto_generate_prime/3
crypto_is_prime/2
Availability:
:- use_module(
library(crypto)
).
(can be
autoloaded
)
[det]
crypto_generate_prime
(
+N, -P, +Options
)
Generate a prime
P
with at least
N
bits.
Options
is a list of options. Currently, the only supported option is:
safe
(
Boolean
)
If
Boolean
is
true
(default is
false
), then a
safe
prime is generated. This means that
P
is of the form 2*Q + 1 where Q is also prime.