def gcd
import bend-collections-laws-crypto@1.0.0.0/src/math/generic.bend as Genericimport Base
import bend-collections-laws-crypto@1.0.0.0/src/math/num.bend as N
312# Euclid when division is native, the binary gcd otherwise
313def gcd(~T: Data, ~op: N.Op<T> -> T, ~test: N.Test<T> -> Bool, +a: T, +b: T) -> T:
314 gcd_pick(~T, ~op, ~test, a, b, test(N.FastDiv{}))