Commit d8da85a9a4bf90cabbe8528391b3bd30506c22cd

Daniel Mendler 2019-10-19T19:54:20

mp_sqrtmod_prime: use mp_set

diff --git a/mp_sqrtmod_prime.c b/mp_sqrtmod_prime.c
index bf72005..03ebf8a 100644
--- a/mp_sqrtmod_prime.c
+++ b/mp_sqrtmod_prime.c
@@ -59,7 +59,7 @@ mp_err mp_sqrtmod_prime(const mp_int *n, const mp_int *prime, mp_int *ret)
    }
 
    /* find a Z such that the Legendre symbol (Z|prime) == -1 */
-   mp_set_u32(&Z, 2u);
+   mp_set(&Z, 2u);
    /* Z = 2 */
    for (;;) {
       if ((err = mp_kronecker(&Z, prime, &legendre)) != MP_OKAY)     goto cleanup;
@@ -79,7 +79,7 @@ mp_err mp_sqrtmod_prime(const mp_int *n, const mp_int *prime, mp_int *ret)
    /* T = n ^ Q mod prime */
    if ((err = mp_copy(&S, &M)) != MP_OKAY)                       goto cleanup;
    /* M = S */
-   mp_set_u32(&two, 2u);
+   mp_set(&two, 2u);
 
    for (;;) {
       if ((err = mp_copy(&T, &t1)) != MP_OKAY)                    goto cleanup;
diff --git a/tommath_class.h b/tommath_class.h
index 9b7f075..f7812da 100644
--- a/tommath_class.h
+++ b/tommath_class.h
@@ -945,7 +945,6 @@
 #   define MP_MOD_D_C
 #   define MP_MULMOD_C
 #   define MP_SET_C
-#   define MP_SET_U32_C
 #   define MP_SQRMOD_C
 #   define MP_SUB_D_C
 #   define MP_ZERO_C