RSA_InitPublicKey, RSA_InitPrivateKeyType1, RSA_InitPrivateKeyType2
RSA_InitPublicKey, RSA_InitPrivateKeyType1, RSA_InitPrivateKeyType2
Initialize user-supplied memory as the
IppsRSAPublicKeyState
or IppsRSAPrivateKeyState
context for future use.Syntax
IppStatus ippsRSA_InitPublicKey(int
rsaModulusBitSize
, int
publicExpBitSize
, IppsRSAPublicKeyState*
pKey
, int
keyCtxSize
);
IppStatus ippsRSA_InitPrivateKeyType1(int
rsaModulusBitSize
, int
privateExpBitSize
, IppsRSAPrivateKeyState*
pKey
, int
keyCtxSize
);
IppStatus ippsRSA_InitPrivateKeyType2(int
factorPBitSize
, int
FactorQBitSize
, IppsRSAPrivateKeyState*
pKey
, int
keyCtxSize
);
Include Files
ippcp.h
Parameters
- rsaModulusBitSize
- Length of the RSA system in bits (that is, the length of the composite RSA modulus n in bits).
- publicExpBitSize
- Length of the RSA public exponent in bits (that is, the length of theecomponent of the RSA public key).
- privateExpBitSize
- Length of the RSA private exponent in bits (that is, the length of thedcomponent of the type 1 RSA private key).
- factorPBitSize,FactorQBitSize
- Length in bits of thepandqfactors of the RSA modulusn=p*q.
- pKey
- Pointer to theIppsRSAPublicKeyStateorIppsRSAPrivateKeyStatecontext being initialized. The context depends on the function.
- keyCtxSize
- Available size in bytes of the memory buffer being initialized.
Description
These functions initialize the memory pointed by
pKey
as the IppsRSAPublicKeyState
or IppsRSAPrivateKeyState
context, depending on the function. To determine the size of the memory buffer, call the appropriate RSA_GetSizePublicKey
, RSA_GetSizePrivateKeyType1
, RSA_GetSizePrivateKeyType2
function prior to calling any of these functions.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.
- ippStsNotSupportedModeErr
- Indicates an error condition ifrsaModulusBitSize< 32 orrsaModulusBitSize> 4096,factorPBitSize< 16 orfactorPBitSize> 4096, orfactorQBitSize< 16 orfactorQBitSize> 4096.
- ippStsBadArgErr
- Indicates an error condition ifpublicExpBitSize>rsaModulusBitSizeorprivateExpBitSize>rsaModulusBitSize.
- ippStsMemAllocErr
- Indicates an error condition if the allocated memory is insufficient for the operation.