Skip to content

Commit d8da85a

Browse files
minadsjaeckel
authored andcommitted
mp_sqrtmod_prime: use mp_set
1 parent f0c83ae commit d8da85a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

mp_sqrtmod_prime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ mp_err mp_sqrtmod_prime(const mp_int *n, const mp_int *prime, mp_int *ret)
5959
}
6060

6161
/* find a Z such that the Legendre symbol (Z|prime) == -1 */
62-
mp_set_u32(&Z, 2u);
62+
mp_set(&Z, 2u);
6363
/* Z = 2 */
6464
for (;;) {
6565
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)
7979
/* T = n ^ Q mod prime */
8080
if ((err = mp_copy(&S, &M)) != MP_OKAY) goto cleanup;
8181
/* M = S */
82-
mp_set_u32(&two, 2u);
82+
mp_set(&two, 2u);
8383

8484
for (;;) {
8585
if ((err = mp_copy(&T, &t1)) != MP_OKAY) goto cleanup;

tommath_class.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,6 @@
945945
# define MP_MOD_D_C
946946
# define MP_MULMOD_C
947947
# define MP_SET_C
948-
# define MP_SET_U32_C
949948
# define MP_SQRMOD_C
950949
# define MP_SUB_D_C
951950
# define MP_ZERO_C

0 commit comments

Comments
 (0)