Skip to content

Commit 885e5e1

Browse files
committed
move mp_rand_digit to bn_deprecated.c
1 parent b96d82d commit 885e5e1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

bn_deprecated.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
/* SPDX-License-Identifier: Unlicense */
88
#include <tommath_private.h>
9+
#ifdef BN_MP_RAND_DIGIT_C
10+
mp_err mp_rand_digit(mp_digit *r)
11+
{
12+
mp_err ret = s_mp_rand_source(r, sizeof(mp_digit));
13+
*r &= MP_MASK;
14+
return ret;
15+
}
16+
#endif
917
#ifdef BN_FAST_MP_INVMOD_C
1018
mp_err fast_mp_invmod(const mp_int *a, const mp_int *b, mp_int *c)
1119
{

bn_mp_rand.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ void mp_rand_source(mp_err(*source)(void *out, size_t size))
1010
s_mp_rand_source = (source == NULL) ? s_mp_rand_platform : source;
1111
}
1212

13-
/* makes a pseudo-random int of a given size */
14-
mp_err mp_rand_digit(mp_digit *r)
15-
{
16-
mp_err ret = s_mp_rand_source(r, sizeof(mp_digit));
17-
*r &= MP_MASK;
18-
return ret;
19-
}
20-
2113
mp_err mp_rand(mp_int *a, int digits)
2214
{
2315
int i;

0 commit comments

Comments
 (0)