Hi All, Thanks for all the responses. As mentioned by Matt in the discussion thread,constant_time_msb performs the copy the msb of the input to all of the other bits so the return value should either be one of 0x00000000 or 0xffffffff. I found another interesting thing,constant_time_msb worked as it is without any changes, after I added a printf in constant_time_is_zero_8 test routine to print the return value. I added the printf just before comparing the return value with the expected value. I have confirmed the failures by removing the printf and printing any thing else other than the returned value. Now based on the discussions here and print results I am thinking, after constant_time_msb operation probably overflow bit is set in case of 0xffffffff. And it is not cleared before comparing, hence compare fails. When I add a printf to print the return value probably overflow flag got cleared and things worked. I am planning to attach the debugger to check the flags. I will get back with debugger results. I have attached the test file. Regards Jaya On Fri, Dec 11, 2015 at 11:30 AM, Jeffrey Walton <noloader at gmail.com> wrote: > > 3. The compiler wasn't written by a fanatic who put > > the "right shift of negative signed values is > > undefined" rule above common sense. > > > > This is only implementation-defined behavior, not undefined behavior. > It is > > not permitted to crash the system or launch the missiles. (n1256.pdf > 6.5.7 > > paragraph 5.) > > The potential problem with implementation defined is its not > guaranteed to produce consistent results. Different compilers or > different versions of the same compiler may arrive at different > results. > > In this light, the crash might be welcomed to make it easy to find the > trouble spot :) > _______________________________________________ > openssl-users mailing list > To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20151213/a3d791af/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: constant_time_test.7z Type: application/octet-stream Size: 1661 bytes Desc: not available URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20151213/a3d791af/attachment.obj>