http://benji3up2kxewkqfcq7buxk2xd6zwy3zggnurkrm3l4cvwy2iipvyyad.onion/mirrors/gmpdoc/Binary-GCD.html
This is described
in many textbooks, for example Knuth section 4.5.2 algorithm B. It simply
consists of successively reducing odd operands a and b using a,b = abs(a-b),min(a,b) strip factors of 2 from a The Euclidean GCD algorithm, as per Knuth algorithms E and A, repeatedly
computes the quotient q = floor(a/b) and replaces a,b by v, u - q v .