Cryptography Reference
In-Depth Information
Determine a prime
p_l
of type
CLINT
with
rmin_l
≤
Function:
p_l
≤
rmax_l
and
gcd(
p_l
−
1
,
f_l
)=1
using the FLINT/C
pseudorandom number generators; previous initialization
required via call to the initialization function
InitRand_l
with
suitable parameters.
int
FindPrimeMinMaxGcd_l (CLINT p_l, STATEPRNG *xrstate,
CLINT rmin_l,
CLINT rmax_l, CLINT f_l);
Syntax:
xrstate
(initialized internal state of a pseudorandom
number generator)
rmin_l
(lower bound for
p_l
)
rmax_l
(upper bound for
p_l
)
f_l
(integer that should be relatively prime to
p_l
Input:
−
1
)
p_l
(random, probabilistically determined prime number)
xrstate
(new internal state of the pseudorandom
number generator)
Output:
Return:
E_CLINT_OK
if all OK
E_CLINT_RGE
if
rmin_l
>
rmax_l
or
f_l
is even, or if no prime
number can be found satisfying the given boundary conditions
E_CLINT_RNG
if error in specifying the generator in
xrstate
E_CLINT_RIN
if pseudorandom number generator uninitialized
int
FindPrimeMinMaxGcd_l (CLINT p_l, STATEPRNG *xrstate, CLINT rmin_l,
CLINT rmax_l, CLINT f_l)
{
CLINT t_l, rmin1_l, g_l;
CLINT Pi_rmin_l, Pi_rmax_l, NoofCandidates_l, junk_l;
int error;
Check whether
f_l
is odd.
if (ISEVEN_L (f_l))
{
return E_CLINT_RGE;
}