On 09/19/2013 02:13 AM, James Yonan wrote:
[...]
We can easily specify -Os in the Makefile rather than depending on #pragma 
optimize or __attribute__ optimize if they are considered broken.

Re: arch/*/crypto/... asm, not sure it's worth it given the extra effort to 
develop, test, and maintain asm for all archs.  The two things we care about 
(constant time and performance) seem readily achievable in C.

Regarding O0 vs. Os, I would tend to prefer Os because it's much faster than 
O0, but still carries the desirable property that optimizations that increase 
code size are disabled.  It seems that short-circuit optimizations would be 
disabled by this, since by definition a short-circuit optimization requires the 
addition of a compare and branch.

Ok, if we can make sure that this would overwrite global defaults in any 
circumstances,
then that approach should be fine, imho.

I would suggest that you use the crypto_mem_not_equal() function that you 
originally had
or that I was proposing, and still allow the possibility for an arch optimized 
version,
if people want to.

In that way, it can be kept simple and stupid and easy to review, just like all 
other
util functions such as memcmp etc is implemented in [1].

 [1] http://lingrok.org/xref/linux-net-next/lib/string.c#643
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to