File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/Cryptodome/Util/__pycache__/strxor.cpython-310.pyc
Back
o ;jI � @ sJ d dl mZmZmZmZmZmZ edd�Zddd�Zddd�Z d d � Z dS )� )�load_pycryptodome_raw_lib�c_size_t�create_string_buffer�get_raw_buffer�c_uint8_ptr�is_writeable_bufferzCryptodome.Util._strxoray void strxor(const uint8_t *in1, const uint8_t *in2, uint8_t *out, size_t len); void strxor_c(const uint8_t *in, uint8_t c, uint8_t *out, size_t len); Nc C s� t | �t |�krtd��|du rtt | ��}n|}t|�s!td��t | �t |�kr1tdt | � ��t�t| �t|�t|�tt | ��� |du rKt |�S dS )a� From two byte strings of equal length, create a third one which is the byte-by-byte XOR of the two. Args: term1 (bytes/bytearray/memoryview): The first byte string to XOR. term2 (bytes/bytearray/memoryview): The second byte string to XOR. output (bytearray/memoryview): The location where the result will be written to. It must have the same length as ``term1`` and ``term2``. If ``None``, the result is returned. :Return: If ``output`` is ``None``, a new byte string with the result. Otherwise ``None``. .. note:: ``term1`` and ``term2`` must have the same length. z.Only byte strings of equal length can be xoredN�4output must be a bytearray or a writeable memoryview�9output must have the same length as the input (%d bytes)) �len� ValueErrorr r � TypeError�_raw_strxor�strxorr r r )�term1�term2�output�result� r �J/opt/saltstack/salt/lib/python3.10/site-packages/Cryptodome/Util/strxor.pyr 0 s&