mirror of https://github.com/wolfSSL/wolfssl.git
tfm fp_exptmod_nct: set result to zero when base is zero
parent
20115f0e23
commit
1afc0df83d
|
@ -3171,8 +3171,10 @@ int fp_exptmod_nct(fp_int * G, fp_int * X, fp_int * P, fp_int * Y)
|
|||
int x = fp_count_bits (X);
|
||||
#endif
|
||||
|
||||
/* 0^X mod P = 0 mod P = 0.
|
||||
* Set result to 0 and return early. */
|
||||
if (fp_iszero(G)) {
|
||||
fp_set(G, 0);
|
||||
fp_set(Y, 0);
|
||||
return FP_OKAY;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue