Skip to content

Commit 5d8f04a

Browse files
authored
Merge pull request #241 from fperrad/20190508_lint
more linting
2 parents be7ee4d + 5e66cfc commit 5d8f04a

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

bn_mp_rand.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ static int s_mp_rand_source_platform(void *p, size_t n)
161161
#endif
162162
}
163163

164-
int (*s_rand_source)(void *, size_t) = s_mp_rand_source_platform;
164+
int (*s_rand_source)(void *out, size_t size) = s_mp_rand_source_platform;
165165

166-
void mp_rand_source(int (*get)(void *out, size_t size))
166+
void mp_rand_source(int (*source)(void *out, size_t size))
167167
{
168-
s_rand_source = get == NULL ? s_mp_rand_source_platform : get;
168+
s_rand_source = (source == NULL) ? s_mp_rand_source_platform : source;
169169
}
170170

171171
/* makes a pseudo-random int of a given size */

bn_mp_reduce_is_2k.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ int mp_reduce_is_2k(const mp_int *a)
2424
return MP_NO;
2525
}
2626
iz <<= 1;
27-
if (iz > (mp_digit)MP_MASK) {
27+
if (iz > MP_MASK) {
2828
++iw;
2929
iz = 1;
3030
}

tommath.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ int mp_rand(mp_int *a, int digits);
306306
/* makes a pseudo-random small int of a given size */
307307
MP_DEPRECATED(mp_rand) int mp_rand_digit(mp_digit *r);
308308
/* use custom random data source instead of source provided the platform */
309-
void mp_rand_source(int source(void *, size_t));
309+
void mp_rand_source(int source(void *out, size_t size));
310310

311311
#ifdef MP_PRNG_ENABLE_LTM_RNG
312312
# warning MP_PRNG_ENABLE_LTM_RNG has been deprecated, use mp_rand_source instead.

tommath_private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ extern void MP_FREE(void *mem, size_t size);
7070
#define MP_MAXFAST (int)(1u << (MP_SIZEOF_BITS(mp_word) - (2u * (size_t)MP_DIGIT_BIT)))
7171

7272
/* random number source */
73-
extern int (*s_rand_source)(void *, size_t);
73+
extern int (*s_rand_source)(void *out, size_t size);
7474

7575
/* lowlevel functions, do not call! */
7676
int s_mp_add(const mp_int *a, const mp_int *b, mp_int *c);

0 commit comments

Comments
 (0)