From 416ab7ac5b193fdfcfc4ee00ad78e2ea2581db58 Mon Sep 17 00:00:00 2001 From: Roker Date: Sun, 6 Sep 2020 22:30:00 +0200 Subject: [PATCH] Aargl!! On equality, d==0! Might solve JSON-164? --- constant_time_algo.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/constant_time_algo.cc b/constant_time_algo.cc index 186a3e2..6e4c2c4 100644 --- a/constant_time_algo.cc +++ b/constant_time_algo.cc @@ -13,7 +13,8 @@ namespace pEp d |= ( static_cast(a[idx]) ^ static_cast(b[idx]) ); } - return d != 0; + // if d is still 0, the strings are equal. + return d == 0; } } // end of namespace pEp