Skip to main content

fermat

Function fermat 

Source
pub fn fermat(n: &BigInt, max_iters: u64) -> Option<(BigInt, BigInt)>
Expand description

Fermat’s method: catches primes that sit too closeN = a² − b² with a just above √N, so a few steps expose (a−b, a+b). Structurally, close primes are a compressed key (one prime nearly fixes the other).