Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/Crypto/Cipher/__pycache__/DES3.cpython-39.pyc
Ðазад
a c�h � @ s� d Z ddlZddlmZ ddlmZmZmZmZ ddl m Z mZmZm Z e dd�Zdd � Zd d� Zdd � ZdZdZdZdZdZdZdZdZdZdS )a� Module's constants for the modes of operation supported with Triple DES: :var MODE_ECB: :ref:`Electronic Code Book (ECB) <ecb_mode>` :var MODE_CBC: :ref:`Cipher-Block Chaining (CBC) <cbc_mode>` :var MODE_CFB: :ref:`Cipher FeedBack (CFB) <cfb_mode>` :var MODE_OFB: :ref:`Output FeedBack (OFB) <ofb_mode>` :var MODE_CTR: :ref:`CounTer Mode (CTR) <ctr_mode>` :var MODE_OPENPGP: :ref:`OpenPGP Mode <openpgp_mode>` :var MODE_EAX: :ref:`EAX Mode <eax_mode>` � N)�_create_cipher)�byte_string�bchr�bord�bstr)�load_pycryptodome_raw_lib�VoidPointer�SmartPointer�c_size_tzCrypto.Cipher._raw_des3a� int DES3_start_operation(const uint8_t key[], size_t key_len, void **pResult); int DES3_encrypt(const void *state, const uint8_t *in, uint8_t *out, size_t data_len); int DES3_decrypt(const void *state, const uint8_t *in, uint8_t *out, size_t data_len); int DES3_stop_operation(void *state); c sp dd� � t | �tvrtd��d�� fdd�| D ��}|dd� |dd � ksd|d d� |dd� krltd��|S ) am Set the parity bits in a TDES key. :param key_in: the TDES key whose bits need to be adjusted :type key_in: byte string :returns: a copy of ``key_in``, with the parity bits correctly set :rtype: byte string :raises ValueError: if the TDES key is not 16 or 24 bytes long :raises ValueError: if the TDES key degenerates into Single DES c S s0 d}t dd�D ]}|| |? d@ N }q| d@ |B S )N� � � )�range)Zkey_byteZparity�i� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/Crypto/Cipher/DES3.py�parity_byteI s z&adjust_key_parity.<locals>.parity_bytezNot a valid TDES key� c s g | ]}t � t|����qS r )r r )�.0�x�r r r � <listcomp>R r z%adjust_key_parity.<locals>.<listcomp>Nr � i�i����z(Triple DES key degenerates to single DES)�len�key_size� ValueError�join)�key_inZkey_outr r r �adjust_key_parity<