Validates key components of the RSA cryptographic system.
IppStatus ippsRSAValidate(const IppsBigNumState* pE, int nTrials, Ipp32u* pResult, IppsRSAState* pCtx, IppBitSuppler rndFunc, void* pRndParam);
pE |
Pointer to the IppsBigNumState context of the RSA public exponent (e). |
nTrails |
Parameter that determines the probability of primality for each P and Q factors of RSA modulo N. |
pResult |
Pointer to the result of validation. |
pCtx |
Pointer to the IppsRSAState context. |
rndFunc |
Pseudorandom number generator. |
pRndParam |
Pointer to the context of the pseudorandom number generator. |
This function is declared in the ippcp.h file. The function validates key components of the RSA cryptographic system and stores the result (IS_VALID_KEY, IS_INVALID_KEY, or IS_INCOMPLETED_KEY) of the validation procedure in *pResult.
The meanings of the values of *pResult are as follows:
IS_VALID_KEY |
The RSA key is valid. The private key is valid if it meets all the following conditions:
|
IS_INVALID_KEY |
The RSA key is not valid. The key is invalid if any of the above conditions is not met. |
IS_INCOMPLETED_KEY |
Some of the necessary key components of the quintuple (p, q, dP, dQ, or qInv) are not available. |
Prepare the contexts for a call to RSAValidate as follows:
Initialize the pCtx* context for a private-key RSA system.
To do this, supply flag==IppRSAprivate to the RSAInit function.
Set up the private key in the form of a quintuple (p, q, dP, dQ, qInv).
There are two ways to do this:
Set each component explicity through a sequence of calls to RSASetKey with IppRSAkeyP, IppRSAkeyQ, IppRSAkeyDp, IppRSAkeyDq, and IppRSAkeyQinv key tags.
Use a sequence of calls to RSASetKey with IppRSAkeyP, IppRSAkeyQ, and IppRSAkeyD key tags. This suffices because in this case all the other key components are computed implicitly.
Because the RSAGenerate and RSAValidate functions use similar algorithms, RSAValidate is unnecessary if the RSA system is generated by RSAGenerate. Call RSAValidate when RSA keys are got from outside and you are not sure whether they are valid.
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. |
ippStsContextMatchErr |
Indicates an error condition if the context parameter does not match the operation. |
ippStsBadArgErr |
Indicates an error condition if nBitsN > nBitsP or nTrials < 1. |
ippStsLengthErr |
Indicates an error condition if the length of the Big Number specified by pE is less than 1. |
ippStsOutOfRangeErr |
Indicates an error condition if the length of the Big Number specified by pE is too big to be stored in the IppsRSAState context. |
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.