-4Ow d Z dgZddlmZ ddlmZmZmZmZm Z m
Z
mZmZ ddl
mZ edd Z G d de Zd Zd
S )z'
Ciphertext Block Chaining (CBC) mode.
CbcMode )_copy_bytes)load_pycryptodome_raw_libVoidPointercreate_string_bufferget_raw_bufferSmartPointerc_size_tc_uint8_ptris_writeable_buffer)get_random_byteszCrypto.Cipher._raw_cbca
int CBC_start_operation(void *cipher,
const uint8_t iv[],
size_t iv_len,
void **pResult);
int CBC_encrypt(void *cbcState,
const uint8_t *in,
uint8_t *out,
size_t data_len);
int CBC_decrypt(void *cbcState,
const uint8_t *in,
uint8_t *out,
size_t data_len);
int CBC_stop_operation(void *state);
c ( e Zd ZdZd ZddZddZdS )r a[ *Cipher-Block Chaining (CBC)*.
Each of the ciphertext blocks depends on the current
and all previous plaintext blocks.
An Initialization Vector (*IV*) is required.
See `NIST SP800-38A`_ , Section 6.2 .
.. _`NIST SP800-38A` : http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
:undocumented: __init__
c F 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 CBC 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.
z)Error %d while instantiating the CBC modeNencryptdecrypt)r _stateraw_cbc_libCBC_start_operationgetr r
len
address_of
ValueErrorr CBC_stop_operationrelease
block_sizer ivIV_next)selfblock_cipherr results y/builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Cipher/_mode_cbc.py__init__zCbcMode.__init__N s " "mm001A1A1C1C1