Visible to Intel only — GUID: GUID-ABD32105-39B3-4CF9-A79B-C6919FFE748F
Visible to Intel only — GUID: GUID-ABD32105-39B3-4CF9-A79B-C6919FFE748F
PrimeGen
Generates a random probable prime number of the specified bitlength.
Syntax
IppStatus ippsPrimeGen(int nBits, int nTrials, IppsPrimeState* pCtx, IppBitSupplier rndFunc, void* pRndParam);
Include Files
ippcp.h
Parameters
nBits |
Target bitlength for the desired probable prime number. |
nTrials |
Security parameter specified for the Miller-Rabin probable primality. |
pCtx |
Pointer to the IppsPrimeState context. |
rndFunc |
Specified Random Generator. |
pRndParam |
Pointer to the Random Generator context. |
Description
The function employs the rndFuncRandom Generator specified by the user to generate a random probable prime number of the specified nBits length. The generated probable prime number is further validated by the Miller-Rabin primality test scheme with the specified security parameter nTrials.
Return Values
ippStsNoErr |
Indicates no error. Any other value indicates an error or warning. |
ippStsNullPtrErr |
Indicates an error condition if any of the specified pointers is NULL. |
ippStsLengthErr |
Indicates an error condition if nBits is less than 1. |
ippStsContextMatchErr |
Indicates an error condition if the context parameter does not match the operation. |
ippStsBadArgErr |
Indicates an error condition if nTrials is less than 1. |
ippStsOutOfRangeErr |
Indicates an error condition if nBits > nMaxBits (see PrimeGetSize and PrimeInit) |
ippStsInsufficientEntropy |
Indicates a warning condition if prime generation fails due to poor choice of entropy. |