|
Message-ID: <20150824223740.GA26955@openwall.com> Date: Tue, 25 Aug 2015 01:37:40 +0300 From: Solar Designer <solar@...nwall.com> To: john-dev@...ts.openwall.com Subject: Re: PHC: Argon2 on GPU On Tue, Aug 25, 2015 at 12:24:49AM +0200, Agnieszka Bielec wrote: > 2015-08-23 9:21 GMT+02:00 Solar Designer <solar@...nwall.com>: > > Also, right now opencl_blake2-round-no-msg.h uses rotate() with negative > > shift counts. We should change this to use the corresponding positive > > shift counts instead. > > why? I just changed -63 to 1 in one case but the rest have values > bigger than -32 Is it stated anywhere that negative or/and over-large shift counts have a defined behavior? In C, that's UB. Even if for OpenCL's rotate() this is defined in a specific way(*), it's better not to get into that bad habit (it will then bite you in C or the like). (*) For amd_bitalign(), it is in fact said that the shift count is taken "& 31" (which I found inconvenient since 32 would have been useful as a way to fully shift in the high 32 bits when using a runtime computed shift count). However, I didn't see anything like that for rotate(). Alexander
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.