Skip to content

Commit 7e3065b

Browse files
authored
Update randEngine.c
1 parent 38b25a0 commit 7e3065b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

DCC-Miner/DCC-Miner/randEngine.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ static int stdlib_rand_bytes(unsigned char* buf, int num)
5050
return 1;
5151
}
5252

53+
// Fill the buffer with random numbers 0-9. For each byte in the buffer, we generate
54+
// a random number and clamp it to the range 0-9.
55+
static int stdlib_rand_numeric_string(unsigned char* buf, int num)
56+
{
57+
for (int index = 0; index < num; ++index)
58+
{
59+
buf[index] = (rand() % 10) + '0';
60+
}
61+
return 1;
62+
}
63+
5364
// Create the table that will link OpenSSL's rand API to our functions.
5465
static RAND_METHOD stdlib_rand_meth = {
5566
stdlib_rand_seed,
@@ -95,4 +106,4 @@ void createRSAKey() {
95106
// Clear memory
96107
BN_free(bn);
97108
RSA_free(rsa);
98-
}
109+
}

0 commit comments

Comments
 (0)