Skip to content
Snippets Groups Projects
Commit da21f26f authored by William KOCH's avatar William KOCH
Browse files

quadratic residue check

parent 73162154
No related branches found
No related tags found
No related merge requests found
use num_bigint::{BigUint};
// a is assumed to be co-prime
// quadratic residue check
pub fn is_quadratic_residue(a: &BigUint, p: &BigUint) -> bool {
a.modpow((p-1)/2, p) == 1
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment