EM d Z dgZddlmZ ddlmZmZmZmZm Z m
Z
mZmZ ddl
mZ edd Z G d de Zd Zd
S )z
Output Feedback (CFB) mode.
OfbMode )_copy_bytes)load_pycryptodome_raw_libVoidPointercreate_string_bufferget_raw_bufferSmartPointerc_size_tc_uint8_ptris_writeable_buffer)get_random_byteszCrypto.Cipher._raw_ofba
int OFB_start_operation(void *cipher,
const uint8_t iv[],
size_t iv_len,
void **pResult);
int OFB_encrypt(void *ofbState,
const uint8_t *in,
uint8_t *out,
size_t data_len);
int OFB_decrypt(void *ofbState,
const uint8_t *in,
uint8_t *out,
size_t data_len);
int OFB_stop_operation(void *state);
c ( e Zd ZdZd ZddZddZdS )r a *Output FeedBack (OFB)*.
This mode is very similar to CBC, but it
transforms the underlying block cipher into a stream cipher.
The keystream is the iterated block encryption of the
previous ciphertext block.
An Initialization Vector (*IV*) is required.
See `NIST SP800-38A`_ , Section 6.4.
.. _`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 )aS Create a new block cipher, configured in OFB 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 a nonce, to to be reused for any other
message**. It shall be a nonce or a random value.
Reusing the *IV* for encryptions performed with the same key
compromises confidentiality.
z)Error %d while instantiating the OFB modeNencryptdecrypt)r _stateraw_ofb_libOFB_start_operationgetr r
len
address_of
ValueErrorr OFB_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_ofb.py__init__zOfbMode.__init__I s $ "mm001A1A1C1C1