Sets the tag-designated key component into the established RSA context.
IppStatus ippsRSASetKey(const IppsBigNumState* pBN, IppsRSAKeyTag tag, IppsRSAState* pCtx);
pBN |
Pointer to the Big Number context presented by key component. |
tag |
The tag of the key component being set up. |
pCtx |
Pointer to the IppsRSAState context. |
This function is declared in the ippcp.h file. The function sets the key specified by pBN to the tag-designated component of the IppRSAState context:
The values of p, q, dP, dQ, qInv, and e must meet the following equations:
e*dP = 1 mod (p - 1)
e*dQ = 1 mod (q - 1)
q*qInv = 1 mod p .
The sequence of function calls
ippsRSASetKey(pBN_E, IppRSAkeyE, pRSActx);
ippsRSASetKey(pBN_N, IppRSAkeyN, pRSActx);
defines the public key of the RSA cryptosystem.
The sequence of function calls
ippsRSASetKey(pBN_D, IppRSAkeyD, pRSActx);
ippsRSASetKey(pBN_N, IppRSAkeyN, pRSActx);
defines the RSA private key with its type 1 representation.
The sequence of function calls
ippsRSASetKey(pBN_P, IppRSAkeyP, pRSActx);
ippsRSASetKey(pBN_Q, IppRSAkeyQ, pRSActx);
ippsRSASetKey(pBN_dP, IppRSAkeyDp, pRSActx);
ippsRSASetKey(pBN_dQ, IppRSAkeyDq, pRSActx);
ippsRSASetKey(pBN_qInv, IppRSAkeyQinv, pRSActx);
defines the RSA private key with its type 2 representation.
Representation types for a private key of an RSA cryptosystem are defined in [PKCS 1.2.1].
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 the length of the Big Number specified by pBN is less than 1. |
ippStsBadArgErr |
Indicates an error condition if some of the arguments are invalid: Big Number specified by pBN is negative, key component specified by tag does not match the RSA context. |
ippStsContextMatchErr |
Indicates an error condition if the context parameter does not match the operation. |
ippStsOutOfRangeErr |
Indicates an error condition if the length of the Big Number specified by pBN is too big to be stored in the IppsRSAState context. |
Copyright © 2000 - 2010, Intel Corporation. All rights reserved.