kikawet / AKSPrimalityTest-Rust

Rust implementation of AKS primality test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AKSPrimalityTest-Rust

What is My Project?

Proof of concept programming AKS primality test in rust using vscode with remote code using a docker container

Run

List of primes numbers - https://primes.utm.edu/lists/small/small.html

cargo run --release -- <CANDIDATE>

Tests

cargo tests --release -- --tests-threads 3

Version

  • cargo 1.56.0
  • rustc 1.56.1

DONE

  • read user input
  • create base structure
  • import into docker
  • add tests
    • test 1 - If n = a^b for integers a > 1 and b > 1, output composite.
    • step 2 - Find the smallest r such that Or(n) > (log2 n)^2
    • test 3 - If 1 < gcd(a,n) < n for some a ≤ r, output composite
    • test 4 - If n ≤ r, output prime
    • test 5 - check that for every coeficient (ai) in (x-1)^n ai%n == 0 // Calculate binomials like madman
  • add tests to the fn is_prime
  • make sure tests actually pass 😒
  • refactor into multiple modules
  • profile -> https://github.com/svenstaro/cargo-profiler

About

Rust implementation of AKS primality test


Languages

Language:Rust 94.4%Language:Dockerfile 5.6%