Reading an excellent article explaining Bleichenbacher attack I came across the following statements under the formula for $s_i$:
if we pick $r ≥ 2(bs_{i-1} - 2B) / n$, we obtain
$(2B + 2(bs_{i-1} - 2B)) / b = 2s_{i-1} ≤ s_i$
Can anyone explain to me how the previous equality is obtained? If we try to reproduce it, we'll obviously get:
$(2B + 2bs_{i-1} - 4B)/b=(2bs_{i-1} - 2B)/b=2s_{i-1} - 2B/b$
Why the authors conclude that the result behind is equal $2s_{i-1}$? Moreover, in the code later they use
r = ceil((b*si - B2)*2,n) # starting value for r
as a starting point for $r$...