version 1.12, 2005/07/17 07:17:55 |
version 1.12.2.1, 2006/10/06 03:19:32 |
|
|
* Second step: test primes' safety (processor intensive) |
* Second step: test primes' safety (processor intensive) |
*/ |
*/ |
|
|
#include "includes.h" |
#include <sys/types.h> |
#include "xmalloc.h" |
|
#include "log.h" |
|
|
|
#include <openssl/bn.h> |
#include <openssl/bn.h> |
|
|
|
#include <stdio.h> |
|
#include <stdlib.h> |
|
#include <string.h> |
|
#include <stdarg.h> |
|
#include <time.h> |
|
|
|
#include "xmalloc.h" |
|
#include "log.h" |
|
|
/* |
/* |
* File output defines |
* File output defines |
*/ |
*/ |
|
|
largewords = (largememory << SHIFT_MEGAWORD); |
largewords = (largememory << SHIFT_MEGAWORD); |
} |
} |
|
|
TinySieve = calloc(tinywords, sizeof(u_int32_t)); |
TinySieve = xcalloc(tinywords, sizeof(u_int32_t)); |
if (TinySieve == NULL) { |
|
error("Insufficient memory for tiny sieve: need %u bytes", |
|
tinywords << SHIFT_BYTE); |
|
exit(1); |
|
} |
|
tinybits = tinywords << SHIFT_WORD; |
tinybits = tinywords << SHIFT_WORD; |
|
|
SmallSieve = calloc(smallwords, sizeof(u_int32_t)); |
SmallSieve = xcalloc(smallwords, sizeof(u_int32_t)); |
if (SmallSieve == NULL) { |
|
error("Insufficient memory for small sieve: need %u bytes", |
|
smallwords << SHIFT_BYTE); |
|
xfree(TinySieve); |
|
exit(1); |
|
} |
|
smallbits = smallwords << SHIFT_WORD; |
smallbits = smallwords << SHIFT_WORD; |
|
|
/* |
/* |