RSA_ValidateKeys
RSA_ValidateKeys
Validates key components of the RSA cryptographic system.
Syntax
IppStatus ippsRSA_ValidateKeys(int*
pResult
, const IppsRSAPublicKeyState*
pPublicKey
, const IppsRSAPrivateKeyState*
pPrivateKeyType2
, const IppsRSAPrivateKeyState*
pPrivateKeyType1
, Ipp8u*
pScratchBuffer
, int
nTrials
, IppsPrimeState*
pPrimeGen
, IppBitSupplier
rndFunc
, void*
pRndParam
);
Include Files
ippcp.h
Parameters
- pResult
- Pointer to the result of validation.
- pPublicKey
- Pointer to the RSA public key.
- pPrivateKeyType2
- Pointer to the RSA private key type 2.
- pPrivateKeyType1
- Pointer to the RSA private key type 1. This parameter is optional and can have the value ofNULL.
- pScratchBuffer
- Pointer to the temporary buffer of size not less than returned by theRSA_GetBufferSizePrivateKeyfunction.
- nTrials
- Security parameter specified for the Miller-Rabin test for probable primality.
- pPrimeGen
- Pointer to the prime number generator.
- rndFunc
- Pseudorandom number generator.
- pRndParam
- Pointer to the context of the pseudorandom number generator.
Description
The function validates key components of the RSA cryptographic system and stores the result of the validation procedure in
*pResult
.The meanings of values of
*pResult
are as follows:- IS_VALID_KEY
- The RSA key pair is valid.
- IS_INVALID_KEY
- The RSA key is not valid.
The key pair is valid under the following conditions:
- Thepandqfactors are prime.
- The type 2 private key meets these conditions:
- e*dP= 1 (modp-1) ande*dQ= 1 (modq-1)
- q*qInv= 1 (modp)
- If thepPrivateKeyType1parameter is notNULL, the type 1 private key meets the conditione*d= 1 mod ((p-1)*(q-1)).
Validation of the public and type 1 private key pair requires type 2 private key.
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 the prime number generator, specified bypPrimeGen, is not sufficient to generate suitable values.
- ippStsIncompleteContextErr
- Indicates an error condition if the public or private key is not set up.
- ippStsBadArgErr
- Indicates an error condition if any of the RSA keys*pPublicKey,*pPrivateKeyType2, or, optional,*pPrivateKeyType1is not properly set up or generated.