RSA_SetPublicKeyPart, RSA_SetPrivateKeyType1Part, RSA_SetPrivateKeyType2Part#
Set up individual components of an RSA key in the existing RSA key context.
Syntax#
IppStatus ippsRSA_SetPublicKeyPart(IppRSAKeyTag keyTag, const IppsBigNumState* pValue, IppsRSAPublicKeyState* pKey);
IppStatus ippsRSA_SetPrivateKeyType1Part(IppRSAKeyTag keyTag, const IppsBigNumState* pValue, IppsRSAPrivateKeyState* pKey);
IppStatus ippsRSA_SetPrivateKeyType2Part(IppRSAKeyTag keyTag, const IppsBigNumState* pValue, IppsRSAPrivateKeyState* pKey);
Include Files#
ippcp.h
Parameters#
keyTag |
Specifies which component of the key to set. See table below for valid values per function. |
pValue |
Pointer to the big number containing the component value to be set. |
pKey |
Pointer to the IppsRSAPublicKeyState or IppsRSAPrivateKeyState context. |
Valid keyTag Values#
Function |
Valid keyTag Values |
Description |
|---|---|---|
RSA_SetPublicKeyPart |
|
RSA modulus |
|
RSA public exponent |
|
RSA_SetPrivateKeyType1Part |
|
RSA modulus |
|
RSA private exponent |
|
RSA_SetPrivateKeyType2Part |
|
First prime factor |
|
Second prime factor |
|
|
CRT exponent |
|
|
CRT exponent |
|
|
CRT coefficient |
Description#
These functions provide component-by-component setup of RSA keys, offering greater flexibility compared to setting all components at once.
The RSA_SetPublicKeyPart function sets up individual components of the RSA
public key (n, e) in the IppsRSAPublicKeyState context. Components
can be set in any order.
The RSA_SetPrivateKeyType1Part function sets up individual components of
the RSA type 1 private key (n, d) in the IppsRSAPrivateKeyState
context. Components can be set in any order.
The RSA_SetPrivateKeyType2Part function sets up individual components of the RSA type 2 private key in the IppsRSAPrivateKeyState context with the following behavior:
Components can be set in any order
When both prime factors
pandqand CRT components (dP,dQ,qInv) are set, the modulusn=pxqis automatically computed
Note
For setting all key components at once, use the corresponding batch functions: RSA_SetPublicKey, RSA_SetPrivateKeyType1, RSA_SetPrivateKeyType2.
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 is NULL. |
ippStsContextMatchErr |
Indicates an error condition if any of the context parameters does not match the operation. |
ippStsBadArgErr |
Indicates an error condition if the keyTag parameter is invalid for the respective key type. |
ippStsSizeErr |
Indicates an error condition if the bit length of the component value exceeds the maximum allowed size for that component. |
ippStsOutOfRangeErr |
Indicates an error condition if the component value is not positive. |