From cb3ed6951eee8848c36102fc6c063d247aac4767 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 13 Oct 2014 17:14:10 +0200 Subject: [PATCH] update documentation regarding fp_isprime() --- tfm.tex | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tfm.tex b/tfm.tex index 384d006..a93438e 100644 --- a/tfm.tex +++ b/tfm.tex @@ -412,12 +412,17 @@ the least common multiple of $a$ and $b$ and store it in $c$. To quickly test a number for primality call this function. \index{fp\_isprime} +\index{fp\_isprime\_ex} \begin{verbatim} -int fp_isprime(fp_int *a); +int fp_isprime_ex(fp_int *a, int t); \end{verbatim} This will return \textbf{FP\_YES} if $a$ is probably prime. It uses 256 trial divisions and -eight rounds of Rabin-Miller testing. Note that this routine performs modular exponentiations +$t$ rounds of Rabin-Miller testing. Note that this routine performs modular exponentiations which means that $a$ must be in a valid range of precision. +The valid range of $t$ is $1 \ldots 256$. + +For backwards compatibility reasons the API function fp\_isprime(a) is still available +and simply calls fp\_isprime\_ex(a, 8). \chapter{Porting TomsFastMath} \label{chap:asmops}