RSA in CRT optimization parameters are empty
This commit is contained in:
parent
2bb3f0246f
commit
a6e89d58d4
@ -100,16 +100,11 @@ int rsa_exptmod(const unsigned char *in, unsigned long inlen,
|
|||||||
}
|
}
|
||||||
#endif /* LTC_RSA_BLINDING */
|
#endif /* LTC_RSA_BLINDING */
|
||||||
|
|
||||||
if (key->dP == NULL) {
|
if ((key->dP == NULL) || (mp_get_digit_count(key->dP) == 0)) {
|
||||||
/*
|
/*
|
||||||
* In case CRT optimization parameters are provided,
|
* In case CRT optimization parameters are not provided,
|
||||||
* the private key is directly used
|
* the private key is directly used to exptmod it
|
||||||
*/
|
*/
|
||||||
LTC_ARGCHK(key->dQ == NULL);
|
|
||||||
LTC_ARGCHK(key->qP == NULL);
|
|
||||||
LTC_ARGCHK(key->p == NULL);
|
|
||||||
LTC_ARGCHK(key->q == NULL);
|
|
||||||
/* exptmod it */
|
|
||||||
if ((err = mp_exptmod(tmp, key->d, key->N, tmp)) != CRYPT_OK) { goto error; }
|
if ((err = mp_exptmod(tmp, key->d, key->N, tmp)) != CRYPT_OK) { goto error; }
|
||||||
} else {
|
} else {
|
||||||
/* tmpa = tmp^dP mod p */
|
/* tmpa = tmp^dP mod p */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user