Re: [PATCH] crypto_memcmp: add constant-time memcmp

2013-09-15 Thread James Yonan
On 13/09/2013 02:33, Daniel Borkmann wrote: On 09/11/2013 07:20 PM, James Yonan wrote: On 10/09/2013 12:57, Daniel Borkmann wrote: There was a similar patch posted some time ago [1] on lkml, where Florian (CC) made a good point in [2] that future compiler optimizations could short circuit on

Re: [PATCH] crypto_memcmp: add constant-time memcmp

2013-09-13 Thread Daniel Borkmann
On 09/11/2013 07:20 PM, James Yonan wrote: On 10/09/2013 12:57, Daniel Borkmann wrote: There was a similar patch posted some time ago [1] on lkml, where Florian (CC) made a good point in [2] that future compiler optimizations could short circuit on this. This issue should probably be addressed

Re: [PATCH] crypto_memcmp: add constant-time memcmp

2013-09-11 Thread Marcelo Cerri
The discussion that Daniel pointed out has another interesting point regarding the function name. I don't think it's a good idea to name it crypto_memcpy since it doesn't have behavior the same way as strcmp. Florian suggested in the thread names such crypto_mem_equal, which I think fits better

Re: [PATCH] crypto_memcmp: add constant-time memcmp

2013-09-11 Thread James Yonan
On 10/09/2013 12:57, Daniel Borkmann wrote: There was a similar patch posted some time ago [1] on lkml, where Florian (CC) made a good point in [2] that future compiler optimizations could short circuit on this. This issue should probably be addressed in such a patch here as well. [1]

Re: [PATCH] crypto_memcmp: add constant-time memcmp

2013-09-10 Thread Daniel Borkmann
On 09/10/2013 08:38 PM, James Yonan wrote: When comparing MAC hashes, AEAD authentication tags, or other hash values in the context of authentication or integrity checking, it is important not to leak timing information to a potential attacker. Bytewise memory comparisons (such as memcmp) are