Function g2poly::gcd

source ·
pub fn gcd(a: G2Poly, b: G2Poly) -> G2Poly
Expand description

Calculate the greatest common divisor of a and b

This uses the classic euclidean algorithm to determine the greatest common divisor of two polynomials.

Example

let a = G2Poly(0b11011);
let b = G2Poly(0b100001);
assert_eq!(gcd(a, b), G2Poly(0b11));
assert_eq!(gcd(b, a), G2Poly(0b11));