This project is a benchmarking suite for prime number algorithms. It does not:
- Handle user authentication
- Process sensitive data
- Provide network services
- Execute untrusted code
The security considerations are minimal but documented here for completeness.
| Version | Supported |
|---|---|
| 3.x.x | Active |
| 2.x.x | Maintenance only |
| < 2.0 | Unsupported |
Prime sieve implementations must handle large values carefully:
// BAD: Overflows at n > ~46,340
int p_squared = p * p;
// GOOD: Use appropriate types
uint64_t p_squared = (uint64_t)p * p;All Round 2 (1e9) implementations have been audited for overflow safety.
Bit manipulation macros must validate indices:
// Ensure idx < array_size * 64
#define SET_BIT(arr, idx) (arr[(idx) >> 6] |= (1ULL << ((idx) & 63)))All implementations bounds-check against the declared sieve size.
The benchmarker limits execution time:
- Default timeout: 60 seconds per implementation
- Memory limit: Implicit via segmented sieve design
Users running with n > 10^12 should expect extended runtimes.
If you discover a bug that could cause:
- Incorrect prime counts
- Crashes on valid input
- Undefined behavior
Please open a GitHub issue with:
- Input parameters (n value)
- Implementation file
- Compiler version and flags
- Expected vs actual output
For security-sensitive issues (unlikely in this project), contact:
- Email: security@whispr.dev
- Response time: 72 hours
All implementations are verified against known values:
| n | π(n) | Last Prime |
|---|---|---|
| 500,000 | 41,538 | 499,979 |
| 1,000,000,000 | 50,847,534 | 999,999,937 |
Run verification:
./c-primes-claude.exe | grep "Found"
# Expected: Found 41538 primes...For reproducible builds, pin compiler versions:
# GCC
g++ --version # Tested: 13.2.0
# Flags used
g++ -O3 -march=native -std=c++17 -fltoDifferent optimization levels may produce different timings but identical prime counts.
This project prioritizes correctness over security, as it processes no external input beyond command-line arguments.