Aargl!! On equality, d==0! Might solve JSON-164? Release_2.1.0-RC27 Release_2.1.1
authorRoker <roker@pep-project.org>
Sun, 06 Sep 2020 22:30:00 +0200
changeset 3625ced9536cc23
parent 361 b196466c817f
child 363 11650f95cca3
Aargl!! On equality, d==0! Might solve JSON-164?
constant_time_algo.cc
     1.1 --- a/constant_time_algo.cc	Fri Aug 28 21:40:51 2020 +0200
     1.2 +++ b/constant_time_algo.cc	Sun Sep 06 22:30:00 2020 +0200
     1.3 @@ -13,7 +13,8 @@
     1.4              d |= ( static_cast<unsigned>(a[idx]) ^ static_cast<unsigned>(b[idx]) );
     1.5          }
     1.6          
     1.7 -        return d != 0;
     1.8 +        // if d is still 0, the strings are equal.
     1.9 +        return d == 0;
    1.10      }
    1.11  
    1.12  } // end of namespace pEp