Skip to content

Commit

Permalink
gust_enc: fix prime validation
Browse files Browse the repository at this point in the history
Closes #10
  • Loading branch information
VitaSmith committed Mar 12, 2020
1 parent 3864323 commit 98087a6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions gust_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,16 +700,13 @@ static bool check_for_prime(uint32_t n)

static void compute_prime_list(uint32_t max_value)
{
bool verbose = false;
uint32_t i, cnt = 0;

prime_list = calloc(max_value / 8, 1);
for (i = 2; i < max_value; i++) {
prime_list = calloc((max_value + 7) / 8, 1);
for (i = 2; i <= max_value; i++) {
if (check_for_prime(i)) {
set_prime(i);
cnt++;
if (verbose)
printf ("0x%08x\n", i);
}
}
}
Expand Down

0 comments on commit 98087a6

Please sign in to comment.