Bleichenbacher attack, binary search, formula for $s_i$ 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$...
Okay, I examined this for a while, and I'm pretty sure this is more of an oversight. They probably wanted to take $r\ge2bs_{i-1}-2B=2(bs_{i-1}-B)$. The same correction should go into the code. (Taking $r=2bs_{i-1}-2B$ is indeed too low a value and does not ensure the doubling of $s_i$ at every successive step, so your observation is correct.)