examples/rsa_mb/rsa_mb-1k-type1-encryption-decryption.cpp
/*! Check matching of the private key types */
Check matching of the private key types
Check matching of the private key types
static bool CheckPrivateKeyCompatibility(IppsRSAPrivateKeyState* pPrivKey1, IppsRSAPrivateKeyState* pPrivKey2) {
    bool isMatched = (ippsRSA_GetPrivateKeyType1(NULL, NULL, pPrivKey1) == ippStsNoErr) &&
                    (ippsRSA_GetPrivateKeyType1(NULL, NULL, pPrivKey2) == ippStsNoErr);
    if(!isMatched)
        isMatched = (ippsRSA_GetPrivateKeyType2(NULL, NULL, NULL, NULL, NULL, pPrivKey1) == ippStsNoErr) &&
                   (ippsRSA_GetPrivateKeyType2(NULL, NULL, NULL, NULL, NULL, pPrivKey2) == ippStsNoErr);
    return isMatched;
}
static bool CheckPrivateKeyCompatibility ( IppsRSAPrivateKeyState * pPrivKey1 , IppsRSAPrivateKeyState * pPrivKey2 ) { bool isMatched = ( ippsRSA_GetPrivateKeyType1 ( NULL , NULL , pPrivKey1 ) == ippStsNoErr ) && ( ippsRSA_GetPrivateKeyType1 ( NULL , NULL , pPrivKey2 ) == ippStsNoErr ) ; if ( ! isMatched ) isMatched = ( ippsRSA_GetPrivateKeyType2 ( NULL , NULL , NULL , NULL , NULL , pPrivKey1 ) == ippStsNoErr ) && ( ippsRSA_GetPrivateKeyType2 ( NULL , NULL , NULL , NULL , NULL , pPrivKey2 ) == ippStsNoErr ) ; return isMatched ; }
Check matching of the private key types
Check matching of the private key types
/* Inside ippsRSA_GetPrivateKeyType1 and ippsRSA_GetPrivateKeyType2 there is a check of the pPrivKey type */ /* Check for belonging to the Type2 only if the type of both keys is not Type1 */