Why it matters
Miller-Rabin is standard primality. Understanding shapes crypto.
Advertisement
The architecture
Write n - 1 = 2^s * d.
Test witness a: a^d mod n or a^(2^r * d) mod n = n-1.
Repeat k witnesses.
Advertisement
How it works end to end
Error prob <= (1/4)^k per composite.
Deterministic for small n with specific witnesses.
Uses modexp.