Skip to content

Commit d8d1cfc

Browse files
committed
mp_rand: use #else after arcrandom
1 parent 2a0021a commit d8d1cfc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bn_mp_rand.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ static int s_read_ltm_rng(void *p, size_t n)
130130

131131
static int s_mp_rand_source_platform(void *p, size_t n)
132132
{
133-
int ret = MP_ERR;
134-
135133
#if defined(MP_ARC4RANDOM)
136134
arc4random_buf(p, n);
137135
return MP_OKAY;
138-
#endif
136+
#else
137+
138+
int ret = MP_ERR;
139139

140140
#if defined(MP_WIN_CSP)
141141
ret = s_read_win_csp(p, n);
@@ -146,19 +146,19 @@ static int s_mp_rand_source_platform(void *p, size_t n)
146146
ret = s_read_getrandom(p, n);
147147
if (ret == MP_OKAY) return ret;
148148
#endif
149+
149150
#if defined(MP_DEV_URANDOM)
150151
ret = s_read_dev_urandom(p, n);
151152
if (ret == MP_OKAY) return ret;
152153
#endif
153154

154-
#endif /* MP_WIN_CSP */
155-
156155
#if defined(MP_PRNG_ENABLE_LTM_RNG)
157156
ret = s_read_ltm_rng(p, n);
158157
if (ret == MP_OKAY) return ret;
159158
#endif
160159

161160
return ret;
161+
#endif
162162
}
163163

164164
static int (*s_rand_source)(void *, size_t) = s_mp_rand_source_platform;

0 commit comments

Comments
 (0)