<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=windows-1252">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 10/12/2015 17:53, Matt Caswell
      wrote:<br>
    </div>
    <blockquote class=" cite" id="mid_5669AE1E_7090003_openssl_org"
      cite="mid:5669AE1E.7090003@openssl.org" type="cite">
      <pre wrap="">
On 10/12/15 11:55, Jayalakshmi bhat wrote:
</pre>
      <blockquote class=" cite" id="Cite_9870197" type="cite">
        <pre wrap="">Hi Matt,

Thanks for the patch. Unfortunately patch did not work. I continued
debugging and found that issue was in constant_time_msb.

static inline unsigned int constant_time_msb(unsigned int a) {
-    *return 0 - (a >> (sizeof(a) * 8 - 1));*
+ return (((unsigned)((int)(a) >> (sizeof(int) * 8 - 1))));
}
</pre>
      </blockquote>
      <pre wrap="">
Thanks. Have you analysed why the original version failed? Both versions
look reasonable to me (ignoring the hardcoded 8 - implying a char is 8
bits). I'd really like to understand that before replacing it with
something else which apparently does the same thing. Perhaps you could
post some sample values for "a" and the return value, before and after
your change.
</pre>
    </blockquote>
    <tt>Looking at the provided disassembly, it looks like the <br>
      1.0.2 version triggers a compiler bug which (at least) <br>
      forgets to mask the result down to 8 bits after inlining <br>
      in test_is_zero_8().</tt><tt>   The missing mask with FF occurs <br>
      in multiple functions in the disassembly.<br>
      <br>
    </tt><br>
    <br>
    <pre class="moz-signature" cols="72">Enjoy

Jakob
-- 
Jakob Bohm, CIO, Partner, WiseMo A/S.  <a class="moz-txt-link-freetext" href="https://www.wisemo.com">https://www.wisemo.com</a>
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded </pre>
  </body>
</html>