Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/Cryptodome/Cipher/__pycache__/_mode_cfb.cpython-39.pyc
Ðазад
a c�hE* � @ sp d Z dgZddlmZ ddlmZmZmZmZm Z m Z mZmZ ddl mZ edd�ZG dd� de�Zd d � ZdS )z Counter Feedback (CFB) mode. �CfbMode� )�_copy_bytes)�load_pycryptodome_raw_lib�VoidPointer�create_string_buffer�get_raw_buffer�SmartPointer�c_size_t�c_uint8_ptr�is_writeable_buffer)�get_random_byteszCryptodome.Cipher._raw_cfba int CFB_start_operation(void *cipher, const uint8_t iv[], size_t iv_len, size_t segment_len, /* In bytes */ void **pResult); int CFB_encrypt(void *cfbState, const uint8_t *in, uint8_t *out, size_t data_len); int CFB_decrypt(void *cfbState, const uint8_t *in, uint8_t *out, size_t data_len); int CFB_stop_operation(void *state);c @ s, e Zd ZdZdd� Zd dd�Zd dd�ZdS )r a� *Cipher FeedBack (CFB)*. This mode is similar to CFB, but it transforms the underlying block cipher into a stream cipher. Plaintext and ciphertext are processed in *segments* of **s** bits. The mode is therefore sometimes labelled **s**-bit CFB. An Initialization Vector (*IV*) is required. See `NIST SP800-38A`_ , Section 6.3. .. _`NIST SP800-38A` : http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf :undocumented: __init__ c C s� t � | _t�|�� t|�tt|��t|�| j�� �}|rDt d| ��t | j�� tj�| _|�� t|�| _ tdd|�| _| j| _| j| jg| _dS )a� Create a new block cipher, configured in CFB mode. :Parameters: block_cipher : C pointer A smart pointer to the low-level block cipher instance. iv : bytes/bytearray/memoryview The initialization vector to use for encryption or decryption. It is as long as the cipher block. **The IV must be unpredictable**. Ideally it is picked randomly. Reusing the *IV* for encryptions performed with the same key compromises confidentiality. segment_size : integer The number of bytes the plaintext and ciphertext are segmented in. z)Error %d while instantiating the CFB modeN)r �_state�raw_cfb_libZCFB_start_operation�getr r �lenZ address_of� ValueErrorr ZCFB_stop_operation�release� block_sizer �iv�IV�encrypt�decrypt�_next)�selfZblock_cipherr �segment_size�result� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/Cryptodome/Cipher/_mode_cfb.py�__init__J s"