def strcmp_const_time(s1, s2):
 if (len(s1) != len(s2)):
  return False
 result = 0
 for (a, b) in zip(s1, s2):
  result |= (ord(a) ^ ord(b))
 return (result == 0)

def strcmp_const_time ( s1 , s2 ) : if ( len ( s1 ) != len ( s2 ) ) : return False result = 0 for ( a , b ) in zip ( s1 , s2 ) : result |= ( ord ( a ) ^ ord ( b ) ) return ( result == 0 )
constant-time string comparison .