What are the required steps to properly generate RSA cryptographic systems key pairs?

1) Establish pseudo random generator.

2) Define size of RSA cryptosystem - size of N (kn) and size of P (kp) in bits

3) Define private RSA using 

      √ ippsRSAGetSize(kn, kp, IppRSAprivate, &rsaCtxSize);

      √ ippsRSAInit(kn, kp, IppRSAprivate, pRSActx);

function calls. Where pRSActx is the memory allocated for RSA context

4) Define initial value of the public key E and call

    ippsRSAGenerate(pE, kn, kp, nTrials, pRSActx, rndFunc, pRndParam);

If ippsRSAGenerate returns IppNoErr, then keys are generated.

If  ippsRSAGenerate returns ippStsInsufficientEntropy, then repeat ippsRSAGenerate procedure.
note that ippsRSAGenerate may change initial value of public key E.

When RSA keys are generated by ippsRSAGenerate one may verify generated RSA cryptosystem by ippsRSAValidate call.

If fact both ippsRSAGenerate and ippsRSAValidate are using similar algorithms and usually ippsRSAValidate is unnecessary if RSA is generated by the ippsRSAGenerate.

The ippsRSAValidate call is useful when RSA keys are get from outside and one is not 100% sure that they are valid.



For more complete information about compiler optimizations, see our Optimization Notice.