RSA_SetPublicKey, RSA_SetPrivateKeyType1, RSA_SetPrivateKeyType2
RSA_SetPublicKey, RSA_SetPrivateKeyType1, RSA_SetPrivateKeyType2
Set up an RSA key in the existing RSA key context.
Syntax
IppStatus ippsRSA_SetPublicKey(const IppsBigNumState*
pModulus
, const IppsBigNumState*
pPublicExp
, IppsRSAPublicKeyState*
pKey
);
IppStatus ippsRSA_SetPrivateKeyType1(const IppsBigNumState*
pModulus
, const IppsBigNumState*
pPrivateExp
, IppsRSAPrivateKeyState*
pKey
);
IppStatus ippsRSA_SetPrivateKeyType2(const IppsBigNumState*
pFactorP
, const IppsBigNumState*
pFactorQ
, const IppsBigNumState*
pCrtExpP
, const IppsBigNumState*
pCrtExpQ
, const IppsBigNumState*
pInverseQ
, IppsRSAPrivateKeyState*
pKey
);
Include Files
ippcp.h
Parameters
- pModulus
- The composite RSA modulusn.
- pPublicExp
- Theecomponent of the RSA public key.
- pPrivateExp
- Thedcomponent of the type 1 RSA private key.
- pFactorP,pFactorQ
- Thepandqfactors of the RSA modulusn=p*q.
- pCrtExpP,pCrtExpQ
- ThedPanddQcomponents of the quintuple (p,q,dP,dQ,qInv), which defines a type 2 private key.
- pInverseQ
- TheqInvcomponent of the quintuple (p,q,dP,dQ,qInv).
- pKey
- Pointer to theIppsRSAPublicKeyStateorIppsRSAPrivateKeyStatecontext.
Description
The
RSA_SetPublicKey
function sets up the RSA public key (n
, e
) in the IppsRSAPublicKeyState
context, that is, copies the n
and e
components supplied by the user into the context.The
RSA_SetPrivateKeyType1
function sets up the RSA type 1 private key (n
, d
) in the IppsRSAPrivateKeyState
context, that is, copies the n
and d
components supplied by the user into the context.The
RSA_SetPrivateKeyType2
function sets up the RSA type 2 private key (p,q,dP,dQ,qInv
) in the IppsRSAPrivateKeyState
context, that is, copies user-supplied p
and q
factors of the RSA composite modulus into the context, computes the rest of the key components, and copies them into the context: - dP=qmod (p-1)
- dQ=pmod (q-1)
- qInv= 1/qmodp
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 any of the context parameters does not match the operation.
- ippStsSizeErr
- Indicates an error condition if the bit length of a key component specified by thepModulus,pPublicExp,pPrivateExp,pFactorP, orpFactorQpointer exceeds the bit length specified at the initialization.
- ippStsOutOfRangeErr
- Indicates an error condition if any key component is not positive.