f'mlK d Z dgZddlmZ ddlmZmZmZmZm Z m
Z
mZmZ ddl
mZ edd Z G d de Zd Zd
S )z
Counter Feedback (CFB) mode.
CfbMode )_copy_bytes)load_pycryptodome_raw_libVoidPointercreate_string_bufferget_raw_bufferSmartPointerc_size_tc_uint8_ptris_writeable_buffer)get_random_byteszCrypto.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 ( e Zd ZdZd ZddZddZdS )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 b t | _ t | t | t
t | t
| | j }|rt d|z t | j t j | _ | t | | _
t dd| | _ | j | _ ddg| _ 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 modeNencryptdecrypt)r _stateraw_cfb_libCFB_start_operationgetr r
len
address_of
ValueErrorr CFB_stop_operationrelease
block_sizer ivIV_next)selfblock_cipherr segment_sizeresults y/builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Cipher/_mode_cfb.py__init__zCfbMode.__init__J s ( "mm001A1A1C1C1