Fix some Py2-isms in constant_time_bytes_eq
This commit is contained in:
parent
3579f76dc7
commit
c646e72832
|
@ -307,6 +307,6 @@ def constant_time_bytes_eq(a, b):
|
||||||
if len(a) != len(b):
|
if len(a) != len(b):
|
||||||
return False
|
return False
|
||||||
res = 0
|
res = 0
|
||||||
for i in xrange(len(a)):
|
for i in (xrange if PY2 else range)(len(a)):
|
||||||
res |= ord(a[i]) ^ ord(b[i])
|
res |= byte_ord(a[i]) ^ byte_ord(b[i])
|
||||||
return res == 0
|
return res == 0
|
||||||
|
|
Loading…
Reference in New Issue