[][src]Function solovay_strassen::is_witness

pub fn is_witness<T: ToBigUint>(a: &T, n: &T) -> Option<bool>

Test whether an integer a is a witness for the compositeness of n.

NOTE: This function fails if a < 2 or n < 3.

Examples

use solovay_strassen::is_witness;

let n: u64 = 27;
let a: u64 = 2;
assert!(is_witness(&a, &n).unwrap());