explicit logical XOR

for coverity CID 332946, see #163
This commit is contained in:
Francois Perrad 2019-02-28 11:43:41 +01:00
parent fe4bdf1236
commit 49105f8d8d

View File

@ -64,7 +64,7 @@ int mp_tc_xor(const mp_int *a, const mp_int *b, mp_int *c)
res = mp_xor(a, b, c); res = mp_xor(a, b, c);
if ((sa != sb) && (res == MP_OKAY)) { if ((((sa == MP_NEG) && (sb != MP_NEG)) || ((sa != MP_NEG) && (sb == MP_NEG))) && (res == MP_OKAY)) {
res = mp_sub(c, mx, c); res = mp_sub(c, mx, c);
} }