http://benji3up2kxewkqfcq7buxk2xd6zwy3zggnurkrm3l4cvwy2iipvyyad.onion/mirrors/gmpdoc/Binary-GCD.html
An alternative approach is to keep just
one of a and b odd and iterate a,b = abs(a-b), min(a,b) a = a/2 if even b = b/2 if even This requires about 1.25 iterations per bit, but stripping of a single bit at
each step avoids any branching.