DLPGenerateDH
DLPGenerateDH
Generates domain parameters of the DL-based cryptosystem over GF(p) to use the DH Agreement scheme.
Syntax
IppStatus ippsDLPGenerateDH(const IppsBigNumState*
pSeedIn
, int
nTrials
, IppsDLPState*
pCtx
, IppsBigNumState*
pSeedOut
, int*
pCounter
, IppBitSupplier
rndFunc
, void*
pRndParam
);
Include Files
ippcp.h
Parameters
- pSeedIn
- Pointer to the inputSeed.
- nTrials
- Security parameter specified for the Miller-Rabin probable primality.
- pCtx
- Pointer to the cryptosystem context.
- pSeedOut
- Pointer to the outputSeedvalue (if requested).
- pCounter
- Pointer to thecountervalue (if requested).
- rndFunc
- Specified Random Generator.
- pRndParam
- Pointer to the Random Generator context.
Description
The function generates domain parameters of the DL-based cryptosystem over GF(
p
) to use Diffie-Hellman Agreement scheme. The function uses a procedure specified in [X9.42] for generating both randomized prime p
and r
based on the input *pSeedIn
. Generated primes
r
and p
are further validated through a nTrial
-round Miller-Rabin primality test. Both generation and primality test procedures employ specified rndFunc
Random Generator.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 isNULL.
- ippStsContextMatchErr
- Indicates an error condition if the context parameter does not match the operation.
- ippStsSizeErr
- Indicates an error condition if:peBits< 512 orreBits< 160,peBitsis not divided by 256.
- ippStsRangeErr
- Indicates an error condition if: bitsize of the inputSeedvalue is less thanreBits, not enough space to store the outputSeedvalue (if requested).
- ippStsBadArgErr
- Indicates an error condition ifnTrials< 1.
- ippStsInsuffucientEntropy
- Indicates a warning condition if prime generation fails due to a poor choice of the entropy.