comparison random.c @ 433:c216212001fc

Fix for -pedantic -ansi compilation, change // to /**/, plus some signedness and trailing-comma-in-array issues
author Matt Johnston <matt@ucc.asn.au>
date Fri, 16 Feb 2007 14:42:08 +0000
parents 00703f1df67a
children d82a2a44c684
comparison
equal deleted inserted replaced
432:517e76bdfb2d 433:c216212001fc
212 * */ 212 * */
213 void gen_random_mpint(mp_int *max, mp_int *rand) { 213 void gen_random_mpint(mp_int *max, mp_int *rand) {
214 214
215 unsigned char *randbuf = NULL; 215 unsigned char *randbuf = NULL;
216 unsigned int len = 0; 216 unsigned int len = 0;
217 const char masks[] = {0xff, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f}; 217 const unsigned char masks[] = {0xff, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f};
218 218
219 const int size_bits = mp_count_bits(max); 219 const int size_bits = mp_count_bits(max);
220 220
221 len = size_bits / 8; 221 len = size_bits / 8;
222 if ((size_bits % 8) != 0) { 222 if ((size_bits % 8) != 0) {