Developer Reference

Contents

RSA_GetPublicKey, RSA_GetPrivateKeyType1, RSA_GetPrivateKeyType2

Extracts key components from an RSA key context.

Syntax

IppStatus ippsRSA_GetPublicKey(IppsBigNumState*
pModulus
, IppsBigNumState*
pPublicExp
, const IppsRSAPublicKeyState*
pKey
);
IppStatus ippsRSA_GetPrivateKeyType1(IppsBigNumState*
pModulus
, IppsBigNumState*
pPrivateExp
, const IppsRSAPrivateKeyState*
pKey
);
IppStatus ippsRSA_GetPrivateKeyType2(IppsBigNumState*
pFactorP
, IppsBigNumState*
pFactorQ
, IppsBigNumState*
pCrtExpP
, IppsBigNumState*
pCrtExpQ
, IppsBigNumState*
pInverseQ
, const IppsRSAPrivateKeyState*
pKey
);
Include Files
ippcp.h
Parameters
pModulus
The composite RSA modulus
n
.
pPublicExp
The
e
component of the RSA public key.
pPrivateExp
The
d
component of the type 1 RSA private key.
pFactorP
,
pFactorQ
The
p
and
q
factors of the RSA modulus
n
=
p
*
q
.
pCrtExpP
,
pCrtExpQ
The
dP
and
dQ
components of the quintuple (
p,q,dP,dQ,qInv
).
pInverseQ
The
qInv
component of the quintuple (
p,q,dP,dQ,qInv
).
pKey
Pointer to the
IppsRSAPublicKeyState
or
IppsRSAPrivateKeyState
context.
Description
The
RSA_GetPublicKey
function extracts components of the RSA public key (
n
,
e
) from the
IppsRSAPublicKeyState
context. The
RSA_GetPrivateKeyType1
and
RSA_GetPrivateKeyType2
functions extract components of the RSA private key of the respective type from the
IppsRSAPrivateKeyState
context.
To extract key components selectively, set pointers to the key components that do not need to be extracted to
NULL
.
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.
ippStsSizeErr
Indicates an error condition if the bit length of any specified key component is not sufficient to hold the value.
ippStsIncompleteContextErr
Indicates an error condition if the public or private key is not set up.
While you can set up the public key or type 1 private key in a call to
RSA_SetPublicKey
or
RSA_SetPrivateKeyType1
, respectively, you can set up the type 2 private key in a call to either
RSA_SetPrivateKeyType2
or
RSA_GenerateKeys
.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804