primelib: add fermat probabilistic primality test