handle the return value of function

This commit is contained in:
Francois Perrad 2015-11-13 17:46:32 +01:00 committed by Steffen Jaeckel
parent babf35c64a
commit c0b14e3df4
1 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ int mp_sqrtmod_prime(mp_int *n, mp_int *prime, mp_int *ret)
}
/* find a Z such that the Legendre symbol (Z|prime) == -1 */
mp_set_int(&Z, 2);
if ((res = mp_set_int(&Z, 2)) != MP_OKAY) goto cleanup;
/* Z = 2 */
while(1) {
if ((res = mp_jacobi(&Z, prime, &legendre)) != MP_OKAY) goto cleanup;
@ -96,7 +96,7 @@ int mp_sqrtmod_prime(mp_int *n, mp_int *prime, mp_int *ret)
i++;
}
if (i == 0) {
mp_copy(&R, ret);
if ((res = mp_copy(&R, ret)) != MP_OKAY) goto cleanup;
res = MP_OKAY;
goto cleanup;
}