Division Method =============== Dividing a 256-bit block by a 128-bit number of the form B-3i. We are given: a = {mx, {x3, x2, x1, x0}} Number to divide d = {b1, b0} Divisor Declare q = {0, {0, 0, 0, 0}} Quotient we build r = {0, {0, mx, x3, x2}} Collecting remainder Algorithm: while r >= d: q.x[2]++ r = r - d r = {0, {r.mx, r.x1, r.x2, a.x1}} while r >= d: q.x[1]++ r = r - d r = {r.mx, {r.x2, r.x1, r.x0, a.x0}} while r >= d: q.x[0]++ r = r - d At the end, the remainder has the correct value, and the quotient is in q.