Botan  2.0.1
Crypto and TLS for C++11
Public Member Functions | List of all members
Botan::Zlib_Compression Class Referencefinal

#include <zlib.h>

Inheritance diagram for Botan::Zlib_Compression:
Botan::Stream_Compression Botan::Compression_Algorithm

Public Member Functions

void clear () final override
void finish (secure_vector< uint8_t > &buf, size_t offset) final override
std::string name () const override
void update (secure_vector< uint8_t > &buf, size_t offset, bool flush) final override

Detailed Description

Zlib Compression

Definition at line 19 of file zlib.h.

Member Function Documentation

◆ clear()

void Botan::Stream_Compression::clear ( )

Reset the state and abort the current message; start can be called again to process a new message.

Implements Botan::Compression_Algorithm.

Definition at line 55 of file compress_utils.cpp.

References BOTAN_ASSERT, Botan::copy_mem(), and Botan::PKCS11::flags().

56  {
57  m_stream.reset();
58  }

◆ finish()

void Botan::Stream_Compression::finish ( secure_vector< uint8_t > &  final_block,
size_t  offset 

Finish compressing

final_blockin/out parameter
offsetan offset into final_block to begin processing

Implements Botan::Compression_Algorithm.

Definition at line 111 of file compress_utils.cpp.

References BOTAN_ASSERT.

112  {
113  BOTAN_ASSERT(m_stream, "Initialized");
114  process(buf, offset, m_stream->finish_flag());
115  clear();
116  }
#define BOTAN_ASSERT(expr, assertion_made)
Definition: assert.h:27
void clear() final override

◆ name()

std::string Botan::Zlib_Compression::name ( ) const
name of the compression algorithm

Implements Botan::Compression_Algorithm.

Definition at line 22 of file zlib.h.

22 { return "Zlib_Compression"; }

◆ update()

void Botan::Stream_Compression::update ( secure_vector< uint8_t > &  buf,
size_t  offset,
bool  flush 

Process some data. Input must be in size update_granularity() uint8_t blocks.

bufin/out parameter which will possibly be resized or swapped
offsetan offset into blocks to begin processing
flushif true the compressor will be told to flush state

Implements Botan::Compression_Algorithm.

Definition at line 105 of file compress_utils.cpp.

References BOTAN_ASSERT.

106  {
107  BOTAN_ASSERT(m_stream, "Initialized");
108  process(buf, offset, flush ? m_stream->flush_flag() : m_stream->run_flag());
109  }
#define BOTAN_ASSERT(expr, assertion_made)
Definition: assert.h:27

The documentation for this class was generated from the following files: