result = libcrypto.EVP_CipherInit_ex(self.ctx, cipher_type.cipher, None, key_ptr, iv_ptr, c_int(enc))
if result == 0:
self._clean_ctx()
result = libcrypto.EVP_CipherInit_ex(self.ctx, cipher_type.cipher, None, key_ptr, iv_ptr, c_int(enc))
if result == 0:
self._clean_ctx()
self.cipher_type = cipher_type
self.block_size = self.cipher_type.block_size()
self.cipher_finalized = False
self.cipher_type = cipher_type
self.block_size = self.cipher_type.block_size()
self.cipher_finalized = False
state, they would be processed and returned.
"""
if self.cipher_finalized :
state, they would be processed and returned.
"""
if self.cipher_finalized :
outbuf=create_string_buffer(self.block_size)
self.cipher_finalized = True
outlen=c_int(0)
result = libcrypto.EVP_CipherFinal_ex(self.ctx,outbuf , byref(outlen))
if result == 0:
self._clean_ctx()
outbuf=create_string_buffer(self.block_size)
self.cipher_finalized = True
outlen=c_int(0)
result = libcrypto.EVP_CipherFinal_ex(self.ctx,outbuf , byref(outlen))
if result == 0:
self._clean_ctx()