Re: [PATCH] crypto_mem_not_equal: add constant-time equality testing of memory regions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* James Yonan:

> noinline unsigned long __crypto_mem_not_equal(const void *a, const
> void *b, size_t size);
>
> static inline int crypto_mem_not_equal(const void *a, const void *b,
> size_t size) {
> 	return __crypto_mem_not_equal(a, b, size) != 0UL ? 1 : 0;
> }
>
> This hides the fact that we are only interested in a boolean result
> from the compiler when it's compiling crypto_mem_not_equal.c, but also
> ensures type safety when users test the return value.  It's also
> likely to have little or no performance impact.

Yes, that looks good to me.

(I haven't checked the other parts of your patch, though, especially
those where you adjust all callers.)
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux