Fix some Py2-isms in constant_time_bytes_eq

This commit is contained in:
Jeff Forcier 2014-03-07 12:55:46 -08:00
parent 3579f76dc7
commit c646e72832
1 changed files with 2 additions and 2 deletions

View File

@ -307,6 +307,6 @@ def constant_time_bytes_eq(a, b):
if len(a) != len(b):
return False
res = 0
for i in xrange(len(a)):
res |= ord(a[i]) ^ ord(b[i])
for i in (xrange if PY2 else range)(len(a)):
res |= byte_ord(a[i]) ^ byte_ord(b[i])
return res == 0