From adfa8e1265f6155d1a582baa9929af198bb5d4de Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 1 May 2026 17:45:39 +0200 Subject: Misc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- librecrypt_equal_binary.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'librecrypt_equal_binary.c') diff --git a/librecrypt_equal_binary.c b/librecrypt_equal_binary.c index e1d17cd..21d9224 100644 --- a/librecrypt_equal_binary.c +++ b/librecrypt_equal_binary.c @@ -30,9 +30,12 @@ librecrypt_equal_binary(const void *a, const void *b, size_t len) size_t i; unsigned char r = 0u; + /* For each character pair XOR is zero on and only on equality, + * bitwise OR of all XORs remain 0 if and only if all where equal */ for (i = 0u; i < len; i++) r = (unsigned char)(r | (*x++ ^ *y++)); + /* Prevent compiler from returning early */ (*librecrypt_explicit_____)(r); return r ? 0 : 1; -- cgit v1.2.3-70-g09d2