File: //var/opt/nydus/ops/oscrypto/__pycache__/util.cpython-39.pyc
a
�,�h3 � @ s� d dl mZmZmZmZ d dlZddlmZ ddlm Z m
Z
ejdkrTddlm
Z
n$ejdkrlddlm
Z
nddlm
Z
d d
gZdd � ZdS )� )�unicode_literals�division�absolute_import�print_functionN� )�pretty_message)� type_name�byte_cls�darwin)�
rand_bytes�win32�constant_comparer c C s� t | t�sttdt| ����t |t�s8ttdt|����t| �t|�krLdS tjdk rrdd� | D �} dd� |D �}d}t| |�D ]\}}|||A O }q�|dkS ) z�
Compares two byte strings in constant time to see if they are equal
:param a:
The first byte string
:param b:
The second byte string
:return:
A boolean if the two byte strings are equal
z9
a must be a byte string, not %s
z9
b must be a byte string, not %s
F)� c S s g | ]}t |��qS � ��ord��.0�charr r �>/opt/nydus/tmp/pip-target-wkfpz8uv/lib/python/oscrypto/util.py�
<listcomp>9 � z$constant_compare.<locals>.<listcomp>c S s g | ]}t |��qS r r r r r r r : r r ) �
isinstancer � TypeErrorr r �len�sys�version_info�zip)�a�b�result�x�yr r r r
s&