summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Le Vaillant <glv@posteo.net>2020-01-19 21:36:49 +0100
committerGuillaume Le Vaillant <glv@posteo.net>2020-01-19 21:36:49 +0100
commit5e6147070a16c5f59faa57b552d9a8cdca32e9c5 (patch)
tree47adf36fce91702536c3de40f4ff9013c2924531
parent52de8d7074347a13a5be537f3dddd56729e1cdee (diff)
Add prime-p to the documentation
-rw-r--r--README.org14
1 files changed, 14 insertions, 0 deletions
diff --git a/README.org b/README.org
index dc079f7..49a2c8d 100644
--- a/README.org
+++ b/README.org
@@ -1804,6 +1804,20 @@ against timing attacks.
timing attacks; don't use it on secret data.
+#+NAME: prime-p
+#+BEGIN_SRC lisp
+(prime-p n &optional prng) => boolean
+#+END_SRC
+
+[[prime-p][prime-p]] returns ~t~ if /n/ has a high probability of being a prime number, and
+~nil~ if it is a composite number. The probable primality is determined by
+first doing trial divisions with small primes, then running several
+Miller-Rabin tests with random bases, and finally doing a Lucas test. The
+number of Miller-Rabin tests can be configured using the
+~*number-of-miller-rabin-tests*~ variable. It is 64 by default, which makes the
+probability of returning ~t~ for a composite number to be at most 1/2^128.
+
+
#+NAME: make-random-salt
#+BEGIN_SRC lisp
make-random-salt &optional size => bytes